Re: Adding comments to help understand psql hidden queries - Mailing list pgsql-hackers

From David Christensen
Subject Re: Adding comments to help understand psql hidden queries
Date
Msg-id CAHM0NXjO-Thdj+DqT5SOfLGVP-aVKhguiRfmkLDu4BJ_H-gg0A@mail.gmail.com
Whole thread Raw
In response to Re: Adding comments to help understand psql hidden queries  (Greg Sabino Mullane <htamfids@gmail.com>)
Responses Re: Adding comments to help understand psql hidden queries
List pgsql-hackers
On Fri, Mar 22, 2024 at 9:47 AM Greg Sabino Mullane <htamfids@gmail.com> wrote:
>
> On Thu, Mar 21, 2024 at 6:20 PM Peter Eisentraut <peter@eisentraut.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
closingquery? Probably the 24 stars we currently have to match "QUERY", which it appears nobody has changed for
translationpurposes yet anyway. (If I am reading the code correctly, it would be up to the translators to maintain the
verticalalignment). 

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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs
Next
From: Robert Haas
Date:
Subject: Re: [PATCH] plpython function causes server panic