Re: psql - pager support - using invisible chars for signalling end of report

From: Thomas Munro <thomas(dot)munro(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>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql - pager support - using invisible chars for signalling end of report
Date: 2023-09-06 03:07:00
Message-ID: CA+hUKGJHUabh-QOBj3kLv4oia8fJXayEWbGhw7oSyuXHjKoTNw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Apr 25, 2020 at 3:53 PM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> so 25. 4. 2020 v 2:12 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:
>> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> > pá 24. 4. 2020 v 21:33 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:
>> >> And what will happen when those characters are in the data?
>>
>> > It will be used on pager side as signal so previous rows was really last
>> > row of result, and new row will be related to new result.
>>
>> In other words, it will misbehave badly if those characters appear
>> in the query result. Doesn't sound acceptable to me.
>
>
> It should not be problem, I think
>
> a) it can be applied as special char only when row before was empty
> b) psql formates this char inside query result, so should not be possible to find binary this value inside result.
>
> postgres=# select e'AHOJ' || chr(5) || 'JJJJ';
> ┌──────────────┐
.> │ ?column? │
> ╞══════════════╡
> │ AHOJ\x05JJJJ │
> └──────────────┘
> (1 row)

This sounds better than the QUERY_SEPARATOR hack from commit
664d757531e, and similar kludges elsewhere. I think Pavel and David
are right about NUL being impossible in psql query output, no?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2023-09-06 03:14:18 Re: Improve heapgetpage() performance, overhead from serializable
Previous Message Vik Fearing 2023-09-06 02:31:44 Re: information_schema and not-null constraints