Re: Adding comments to help understand psql hidden queries

From: David Christensen <david+pg(at)pgguru(dot)net>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Adding comments to help understand psql hidden queries
Date: 2024-03-22 15:39:10
Message-ID: CAHM0NXjO-Thdj+DqT5SOfLGVP-aVKhguiRfmkLDu4BJ_H-gg0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 22, 2024 at 9:47 AM Greg Sabino Mullane <htamfids(at)gmail(dot)com> wrote:
>
> On Thu, Mar 21, 2024 at 6:20 PM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>>
>> lines are supposed to align vertically. With your patch, the first line
>> would have variable length depending on the command.
>
>
> Yes, that is a good point. Aligning those would be quite tricky, what if we just kept a standard width for the closing query? Probably the 24 stars we currently have to match "QUERY", which it appears nobody has changed for translation purposes yet anyway. (If I am reading the code correctly, it would be up to the translators to maintain the vertical alignment).

I think it's easier to keep the widths balanced than constant (patch
version included here), but if we needed to squeeze the opening string
to a standard width that would be possible without too much trouble.
The internal comment strings seem to be a bit more of a pain if we
wanted all of the comments to be the same width, as we'd need a table
or something so we can compute the longest string width, etc; doesn't
seem worth the convolutions IMHO.

No changes to Greg's patch, just keeping 'em both so cfbot stays happy.

David

Attachment Content-Type Size
v3-0002-Add-output-of-the-command-that-got-us-here-to-the.patch application/octet-stream 2.9 KB
v3-0001-Include-SQL-comments-on-echo-hidden-output.patch application/octet-stream 14.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-03-22 15:39:43 Re: [PATCH] plpython function causes server panic
Previous Message Tom Lane 2024-03-22 15:27:46 Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs