Re: [PATCHES] selecting large result sets in psql using cursors - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] selecting large result sets in psql using cursors
Date
Msg-id 26613.1155747051@sss.pgh.pa.us
Whole thread Raw
Responses Re: [PATCHES] selecting large result sets in psql using cursors  (Peter Eisentraut <peter_e@gmx.net>)
Re: [PATCHES] selecting large result sets in psql using cursors  (Chris Mair <chrisnospam@1006.org>)
List pgsql-hackers
Chris Mair <list@1006.org> writes:
> attached is the new and fixed version of the patch for selecting
> large result sets from psql using cursors.

The is_select_command bit is wrong because it doesn't allow for left
parentheses in front of the SELECT keyword (something entirely
reasonable when considering big union/intersect/except trees).
Also you'd need to allow for VALUES as the first keyword.
But isn't the whole thing unnecessary?  ISTM you could just ship the
query with the DECLARE CURSOR prepended, and see whether you get a
syntax error or not.

At some point we ought to extend libpq enough to expose the V3-protocol
feature that allows partial fetches from portals; that would be a
cleaner way to implement this feature.  However since nobody has yet
proposed a good API for this in libpq, I don't object to implementing
\u with DECLARE CURSOR for now.

BTW, \u seems not to have any mnemonic value whatsoever ... isn't there
some other name we could use?

            regards, tom lane

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] Forcing current WAL file to be archived
Next
From: Andrew Dunstan
Date:
Subject: Re: Enum proposal / design