Re: psql: Could we get "-- " prefixing on the **** QUERY **** outputs? (ECHO_HIDDEN)

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: psql: Could we get "-- " prefixing on the **** QUERY **** outputs? (ECHO_HIDDEN)
Дата
Msg-id 46a24b58ff9de0c066a32fa9bfac7646baee2780.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: psql: Could we get "-- " prefixing on the **** QUERY **** outputs? (ECHO_HIDDEN)  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: psql: Could we get "-- " prefixing on the **** QUERY **** outputs? (ECHO_HIDDEN)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, 2023-05-15 at 08:37 +0200, Pavel Stehule wrote:
> Dne po 15. 5. 2023 8:01 uživatel Kirk Wolak <wolakk@gmail.com> napsal:
> > This would be a trivial change.  Willing to do it, and push it.
> >
> > In effect, we have this GREAT feature:
> > \set ECHO_HIDDON on
> >
> > Which outputs a bunch of queries (as you all know).
> > But somehow nobody thought that a user might want to paste ALL of the queries into their query editor, or even into
anotherpsql session, via (\e) 
> > and NOT get a ton of syntax errors?
> >
> > As an example: (added -- and a space)
> >
> > -- ********* QUERY **********
> > SELECT c2.relname, i.indisprimary, i.indisunique, i.indisclustered, i.indisvalid,
pg_catalog.pg_get_indexdef(i.indexrelid,0, true), 
> >   pg_catalog.pg_get_constraintdef(con.oid, true), contype, condeferrable, condeferred, i.indisreplident,
c2.reltablespace
> > FROM pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_index i
> >   LEFT JOIN pg_catalog.pg_constraint con ON (conrelid = i.indrelid AND conindid = i.indexrelid AND contype IN
('p','u','x'))
> > WHERE c.oid = '21949943' AND c.oid = i.indrelid AND i.indexrelid = c2.oid
> > ORDER BY i.indisprimary DESC, c2.relname;
> > -- **************************
>
> This looks little bit strange
>
> What about /* comments
>
> Like
>
> /******* Query ********/
>
> Or just 
>
> -------- Query --------

+1 for either of Pavel's suggestions.

Yours,
Laurenz Albe



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Redundant strlen(query) in get_rel_infos
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Redundant strlen(query) in get_rel_infos