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

Поиск
Список
Период
Сортировка
От Kirk Wolak
Тема Re: psql: Could we get "-- " prefixing on the **** QUERY **** outputs? (ECHO_HIDDEN)
Дата
Msg-id CACLU5mSYSC-7waxNE0bsrph7QW9Bq9Dw5M26swmQ6x6iSd1tdQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: psql: Could we get "-- " prefixing on the **** QUERY **** outputs? (ECHO_HIDDEN)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: psql: Could we get "-- " prefixing on the **** QUERY **** outputs? (ECHO_HIDDEN)  (Kirk Wolak <wolakk@gmail.com>)
Список pgsql-hackers
On Mon, May 15, 2023 at 10:28 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> It's worth considering what will readline history do with the comment.
> As I recall, we keep /* comments */ together with the query that
> follows, but the -- comments are keep in a separate history entry.
> So that's one more reason to prefer /*  */

Good point.

> (To me, that also suggests to remove the asterisk line after each query,
> and to keep just the one before.)

Meh ... the one after serves to separate a query from its output.

                        regards, tom lane

Actually, I love the feedback!

I just tested whether or not you see the trailing comment line.  And I ONLY see it in the windows version of PSQL.
And ONLY if you paste it directly in at the command line.
[Because it sends the text line by line, I assume]

Further Testing:

calling with: psql -f  -- no output of the comments (or the query is seen)  -- Windows/Linux

with \e editing... In Linux nothing is displayed from the query!

with \e editing in Windows... I found it buggy when I tossed in (\pset pager 0) as the first line.  It blew everything up (LOL)
\pset: extra argument "attcollation," ignored
\pset: extra argument "a.attidentity," ignored
\pset: extra argument "a.attgenerated" ignored
\pset: extra argument "FROM" ignored
\pset: extra argument "pg_catalog.pg_attribute" ignored


With that said, I DEFINITELY Move to Remove the secondary comment.  It's just noise.
and /* */ comments it will be for the topside.

Also, I will take a quick peek at the parse failure that is in windows \e
[Which always does this weird doubling of lines].  But no promises here.  It will be good enough to identify the problem.

Kirk...

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Introduce WAIT_EVENT_EXTENSION and WAIT_EVENT_BUFFER_PIN
Следующее
От: Kirk Wolak
Дата:
Сообщение: pgbench: can we add a way to specify the schema to write to?