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

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>, Pavel Stehule <pavel.stehule@gmail.com>, Kirk Wolak <wolakk@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-05-15T14:14:57Z
Lists: pgsql-hackers
On 2023-May-15, Tom Lane wrote:

> Laurenz Albe <laurenz.albe@cybertec.at> writes:
> > On Mon, 2023-05-15 at 08:37 +0200, Pavel Stehule wrote:
> >> This looks little bit strange
> >> 
> >> What about /* comments
> >> Like
> >> /******* Query ********/
> >> Or just
> >> -------- Query --------
> 
> > +1 for either of Pavel's suggestions.
> 
> +1.  Probably the slash-star way would be less visually surprising
> to people who are used to the current output.

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 /*  */

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

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Sallah, I said NO camels! That's FIVE camels; can't you count?"
(Indiana Jones)



Commits

  1. Adjust extra lines generated by psql to be valid SQL comments.