Re: patch: psql - enforce constant width of last column

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Ahsan Hadi <ahsan(dot)hadi(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: psql - enforce constant width of last column
Date: 2019-09-18 12:51:09
Message-ID: CAFj8pRBnLecoLhcGOF5xnVqEmdJYCNXRdZWXm3erpx61o2podg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

st 18. 9. 2019 v 12:52 odesílatel Ahsan Hadi <ahsan(dot)hadi(at)gmail(dot)com> napsal:

>
>
> On Tue, Sep 17, 2019 at 8:16 PM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
>
>>
>>
>> út 17. 9. 2019 v 17:06 odesílatel Ahsan Hadi <ahsan(dot)hadi(at)gmail(dot)com>
>> napsal:
>>
>>> Hi Pavel,
>>>
>>> I have been trying to reproduce the case of badly displaying last
>>> columns of a query result-set. I played around with the legal values for
>>> psql border variable but not able to find a case where last columns are
>>> badly displayed. Can you please share an example that I can use to
>>> reproduce this problem. I will try out your patch once I am able to
>>> reproduce the problem.
>>>
>>
>> you need to use pspg, and vertical cursor.
>>
>> https://github.com/okbob/pspg
>> vertical cursor should be active
>>
>
> okay thanks for the info. I don't think it was possible to figure this out
> by reading the initial post. I will check it out.
>
> does this patch have any value for psql without pspg?
>

The benefit of this patch is just for pspg users today.

Pavel

>
>> \pset border 1
>> \pset linestyle ascii
>> \pset pager always
>>
>> select * from generate_series(1,3);
>>
>> Regards
>>
>> Pavel
>>
>>
>>> Thanks,
>>>
>>> -- Ahsan
>>>
>>>
>>> On Mon, Sep 9, 2019 at 2:32 PM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
>>> wrote:
>>>
>>>> Hi
>>>>
>>>> When I played with vertical cursor support I got badly displayed last
>>>> columns when border was not 2. Only when border is 2, then psql displays
>>>> last column with same width for each row.
>>>>
>>>> I think so we can force column width alignment for any border styles
>>>> today (for alignment and wrapping styles) or as minimum this behave can be
>>>> optional.
>>>>
>>>> I wrote a patch with pset option "final_spaces", but I don't see a
>>>> reason why we trim rows today.
>>>>
>>>> Regards
>>>>
>>>> Pavel
>>>>
>>>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-09-18 13:01:09 Re: another look at macOS SIP
Previous Message Alexey Kondratov 2019-09-18 12:46:20 Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly