Re: psql - factor out echo code - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: psql - factor out echo code
Date
Msg-id 202107022107.zu3p2qevtxja@alvherre.pgsql
Whole thread Raw
In response to Re: psql - factor out echo code  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: psql - factor out echo code  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2021-Jul-02, Tom Lane wrote:

> Fabien COELHO <coelho@cri.ensmp.fr> writes:
> > Yes. Maybe decorations should be SQL comments, and the purpose/origin of 
> > the query could be made clear as you suggest, eg something like markdown 
> > in a comment:
> >    "-- # <whatever> QUERY\n%s\n\n"
> 
> If we keep the decoration, I'd agree with dropping all the asterisks.
> I'd vote for something pretty minimalistic, like
> 
>     -- INTERNAL QUERY:

I think the most interesting case for decoration is the "step by step"
mode, where you want the "title" that precedes each query be easily
visible.  I think two uppercase words are not sufficient for that ...
and Markdown format which would force you to convert to HTML before you
can notice where it is, are not sufficient either.  The line with a few
asterisks seems fine to me for that.  Removing the asterisks in the
other case seems fine.  I admit I don't use the step-by-step mode all
that much, though.

Also: one place that prints queries that wasn't mentioned before is
exec_command_print() in command.c.

-- 
Álvaro Herrera              Valdivia, Chile  —  https://www.EnterpriseDB.com/
"Ed is the standard text editor."
      http://groups.google.com/group/alt.religion.emacs/msg/8d94ddab6a9b0ad3



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: psql - factor out echo code
Next
From: Ranier Vilela
Date:
Subject: Re: Fix uninitialized variable access (src/backend/utils/mmgr/freepage.c)