Re: wrapping in extended mode doesn't work well with default pager

From: Sergey Muraviov <sergey(dot)k(dot)muraviov(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <stark(at)mit(dot)edu>, Emre Hasegeli <emre(at)hasegeli(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wrapping in extended mode doesn't work well with default pager
Date: 2014-05-15 13:04:33
Message-ID: CAJTaR33mb50P4sjysaZZm55Rj5mWBCUz62FwJGEfgD38V6daAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.
Please review the new patch.

PS
Issues which were described by Tom and Pavel were relevant to single-line
headers.
So I've added appropriate regression tests to the patch.

I've also attached complex regression tests for unicode linestyle and
multibyte symbols.

2014-05-14 10:55 GMT+04:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:

> sorry
>
> there is still small issue
>
> I have a plpgsql function:
>
> CREATE OR REPLACE FUNCTION public.foo_update_trg()
> RETURNS trigger
> LANGUAGE plpgsql
> AS $function$
> DECLARE t text;
> BEGIN
> EXECUTE format('SELECT $1.%I', TG_ARGV[0]) INTO t USING old;
> RAISE NOTICE 'original value of "%" is "%"', TG_ARGV[0], t;
> RETURN NULL;
> END;
> $function$
>
> Default expanded view of select * from pg_proc where proname =
> 'foo_update_trg'; is little bit broken (screenshoot 1)
>
> After wrap mode, it add useless new line into source code (screenshoot 2)
>
> but border2 fixes it (screenshots 3)
>
> Regards
>
> Pavel
>
>
>
> 2014-05-14 8:32 GMT+02:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
>
> Hello
>>
>> With this patch it works perfect
>>
>> Thank you
>>
>> Regards
>>
>> Pavel
>>
>>
>> 2014-05-13 21:33 GMT+02:00 Sergey Muraviov <sergey(dot)k(dot)muraviov(at)gmail(dot)com>:
>>
>> Please check this patch.
>>>
>>>
>>> 2014-05-12 22:56 GMT+04:00 Sergey Muraviov <sergey(dot)k(dot)muraviov(at)gmail(dot)com>
>>> :
>>>
>>> Hi.
>>>>
>>>> I'll try to fix it tomorrow.
>>>>
>>>>
>>>> 2014-05-12 18:42 GMT+04:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>>>>
>>>> Greg Stark <stark(at)mit(dot)edu> writes:
>>>>> > On Mon, May 12, 2014 at 2:12 PM, Greg Stark <stark(at)mit(dot)edu> wrote:
>>>>> >> Hm, there was an off by one error earlier in some cases, maybe we
>>>>> >> fixed it by breaking other case. Will investigate.
>>>>>
>>>>> > Those spaces are coming from the ascii wrapping indicators. i.e. the
>>>>> periods in:
>>>>>
>>>>> Ah. I wonder whether anyone will complain that the format changed?
>>>>>
>>>>> > Apparently we used to print those with border=1 in normal mode but in
>>>>> > expanded mode we left out the space for those on the outermost edges
>>>>> > since there was no need for them. If we put them in for wrapped mode
>>>>> > then we'll be inconsistent if we don't for nonwrapped mode though.
>>>>> And
>>>>> > if we don't put them in for wrapped mode then there's no way to
>>>>> > indicate wrapping versus newlines.
>>>>>
>>>>> Barring anyone complaining that the format changed, I'd say the issue
>>>>> is not that you added them but that the accounting for line length
>>>>> fails to include them.
>>>>>
>>>>> regards, tom lane
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best regards,
>>>> Sergey Muraviov
>>>>
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Sergey MuraviovH
>>>
>>
>>
>

--
Best regards,
Sergey Muraviov

Attachment Content-Type Size
psql-wrapped-expanded-fix-v3.patch text/x-patch 39.2 KB
psql-complex.out application/octet-stream 130.5 KB
psql-complex.sql application/sql 9.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-05-15 13:15:49 Re: popen and pclose redefinitions causing many warning in Windows build
Previous Message Bruce Momjian 2014-05-15 12:06:04 Re: proposal: Set effective_cache_size to greater of .conf value, shared_buffers