Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs - Mailing list pgsql-hackers

From Tom Lane
Subject Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs
Date
Msg-id 2097213.1672850211@sss.pgh.pa.us
Whole thread Raw
In response to Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs
Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Jan 4, 2023 at 10:22 AM Daniel Verite <daniel@manitou-mail.org> wrote:
>> A solution would be for psql to use PQsetSingleRowMode() to retrieve
>> results row-by-row, as opposed to using a cursor, and then allocate
>> memory for only FETCH_COUNT rows at a time.

> Is there any reason that someone hasn't, like, already done this?

As you well know, psql's FETCH_COUNT mechanism is far older than
single-row mode.  I don't think anyone's tried to transpose it
onto that.  I agree that it seems like a good idea to try.
There will be more per-row overhead, but the increase in flexibility
is likely to justify that.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs
Next
From: jian he
Date:
Subject: Re: Infinite Interval