postgresql/src/backend
Bruce Momjian 54f7338fa1 This patch implements holdable cursors, following the proposal
(materialization into a tuple store) discussed on pgsql-hackers earlier.
I've updated the documentation and the regression tests.

Notes on the implementation:

- I needed to change the tuple store API slightly -- it assumes that it
won't be used to hold data across transaction boundaries, so the temp
files that it uses for on-disk storage are automatically reclaimed at
end-of-transaction. I added a flag to tuplestore_begin_heap() to control
this behavior. Is changing the tuple store API in this fashion OK?

- in order to store executor results in a tuple store, I added a new
CommandDest. This works well for the most part, with one exception: the
current DestFunction API doesn't provide enough information to allow the
Executor to store results into an arbitrary tuple store (where the
particular tuple store to use is chosen by the call site of
ExecutorRun). To workaround this, I've temporarily hacked up a solution
that works, but is not ideal: since the receiveTuple DestFunction is
passed the portal name, we can use that to lookup the Portal data
structure for the cursor and then use that to get at the tuple store the
Portal is using. This unnecessarily ties the Portal code with the
tupleReceiver code, but it works...

The proper fix for this is probably to change the DestFunction API --
Tom suggested passing the full QueryDesc to the receiveTuple function.
In that case, callers of ExecutorRun could "subclass" QueryDesc to add
any additional fields that their particular CommandDest needed to get
access to. This approach would work, but I'd like to think about it for
a little bit longer before deciding which route to go. In the mean time,
the code works fine, so I don't think a fix is urgent.

- (semi-related) I added a NO SCROLL keyword to DECLARE CURSOR, and
adjusted the behavior of SCROLL in accordance with the discussion on
-hackers.

- (unrelated) Cleaned up some SGML markup in sql.sgml, copy.sgml

Neil Conway
2003-03-27 16:51:29 +00:00
..
access This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
bootstrap Add code to dump contents of free space map into $PGDATA/global/pg_fsm.cache 2003-03-06 00:04:27 +00:00
catalog Instead of storing pg_statistic stavalues entries as text strings, store 2003-03-23 05:14:37 +00:00
commands This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
executor This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
lib Remove bit.c/h routines. Not used anymore. 2003-01-09 01:23:55 +00:00
libpq Add start time to pg_stat_activity 2003-03-20 03:34:57 +00:00
main This patch removes a bunch of superfluous #include directives: if 2002-11-08 20:23:57 +00:00
nodes Todo items: 2003-03-20 07:02:11 +00:00
optimizer Tweak selectivity and related routines to cope with domains. Per report 2003-03-23 01:49:02 +00:00
parser This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
po Most of the code follows the American spelling of the word, which is 2002-11-19 17:21:40 +00:00
port Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
postmaster Ignore SIGXFSZ (if platform has it), so that ulimit violations work like 2003-03-24 22:40:14 +00:00
regex Replace regular expression package with Henry Spencer's latest version 2003-02-05 17:41:33 +00:00
rewrite Remove REWRITE_INVOKE_MAX in favor of making an accurate check for 2003-02-25 23:47:43 +00:00
storage This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
tcop This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
utils This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
Makefile Make "win" a separate port from "cygwin". This means you can now 2003-03-21 17:18:34 +00:00
nls.mk Translation updates 2002-09-14 13:46:24 +00:00