Re: very long record lines in expanded psql output

From: Platon Pronko <platon7pronko(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Justin Pryzby <pryzby(at)telsasoft(dot)com>
Subject: Re: very long record lines in expanded psql output
Date: 2021-08-23 18:00:22
Message-ID: 7f3ef168-0958-a33d-6911-bda8999c30c2@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

Apparently I did forget something, and that's the patch itself :)
Thanks for Justin Pryzby for pointing this out.

Attaching the patch now.

Best regards,
Platon Pronko

On 2021-08-23 20:51, Platon Pronko wrote:
> Hi!
>
> Please find attached the patch implementing the proposed changes.
> I hope I didn't forget anything (docs, tab completion, comments, etc),
> if I did forget something please tell me and I'll fix it.
>
> Best regards,
> Platon Pronko
>
> On 2021-08-08 01:18, Andrew Dunstan wrote:
>>
>> On 8/7/21 10:56 AM, Platon Pronko wrote:
>>> Hi!
>>>
>>>>>>>> I also find this annoying and would be happy to be rid of it.
>>>>>>>
>>>>>>> Have you tried "\pset format wrapped"? Pavel suggested it, and it
>>>>>>> solved most of the problem for me, for example.
>>>>>>
>>>>>> Yes, but it changes the data line output. Ideally, you should be able
>>>>>> to  modify these independently.
>>>>>
>>>>> I agree, and I think this can be implemented, but I'm a bit afraid of
>>>>> introducing an additional psql option (there's already quite a lot of
>>>>> them).
>>>>> I suspect primary PostgreSQL maintainers won't be happy with such an
>>>>> approach.
>>>>>
>>>>>
>>>>
>>>> I think I qualify as one of those ... :-)
>>>
>>> Sorry, I'm new here, don't know who's who :)
>>
>>
>> No problem. Welcome! We're always very glad to see new contributors.
>>
>>
>>>
>>> I'll start working on a new patch then. A couple questions about
>>> specifics:
>>>
>>> 1. Can we add "expanded" in the option name, like
>>> "xheader_expanded_width"?
>>> I think adjusting the header row width doesn't make sense on any other
>>> modes,
>>> and placing that in the option name makes intent a bit clearer.
>>
>>
>>
>> "xheader" was meant to be shorthand for "expanded output header"
>>
>>
>>>
>>> 2. What was "column" option in your original suggestion supposed to do?
>>> ("\pset xheader_width column|page|nnn")
>>
>>
>> It's meant to say don't print anything past the column spec, e.g.:
>>
>>
>> -[ RECORD 1 ]----+
>> n                | 42
>> long_column_name | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> -[ RECORD 2 ]----+
>> n                | 210
>> long_column_name | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>
>>
>>>
>>> 3. Should we bother with using this option when in "\pset border 2" mode?
>>> I can do it for consistency, but it will still look bad.
>>>
>>>
>>
>> Probably not, but since I never use it I'll let others who do weigh in
>> on the subject.
>>
>>
>> cheers
>>
>>
>> andrew
>>
>>
>> --
>> Andrew Dunstan
>> EDB: https://www.enterprisedb.com
>>

Attachment Content-Type Size
fix-header-lines-in-expanded-output.patch text/x-patch 9.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2021-08-23 18:11:51 Re: pretty slow merge-join due rescan?
Previous Message Platon Pronko 2021-08-23 17:51:24 Re: very long record lines in expanded psql output