postgresql/src/include/storage
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
..
backendid.h Update copyright to 2002. 2002-06-20 20:29:54 +00:00
block.h Update copyright to 2002. 2002-06-20 20:29:54 +00:00
buf.h Update copyright to 2002. 2002-06-20 20:29:54 +00:00
buf_internals.h pgindent run. 2002-09-04 20:31:48 +00:00
buffile.h This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
bufmgr.h Add DLLIMPORT declarations required by contrib with asserts enabled. 2002-10-22 20:00:48 +00:00
bufpage.h pgindent run. 2002-09-04 20:31:48 +00:00
fd.h This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
freespace.h Add code to dump contents of free space map into $PGDATA/global/pg_fsm.cache 2003-03-06 00:04:27 +00:00
ipc.h pgindent run. 2002-09-04 20:31:48 +00:00
item.h Update copyright to 2002. 2002-06-20 20:29:54 +00:00
itemid.h Update copyright to 2002. 2002-06-20 20:29:54 +00:00
itempos.h Update copyright to 2002. 2002-06-20 20:29:54 +00:00
itemptr.h Update copyright to 2002. 2002-06-20 20:29:54 +00:00
large_object.h Update copyright to 2002. 2002-06-20 20:29:54 +00:00
lmgr.h Back out LOCKTAG changes by Rod Taylor, pending code review. Sorry. 2003-02-19 23:41:15 +00:00
lock.h Back out LOCKTAG changes by Rod Taylor, pending code review. Sorry. 2003-02-19 23:41:15 +00:00
lwlock.h Update copyright to 2002. 2002-06-20 20:29:54 +00:00
off.h This patch fixes a bunch of spelling mistakes in comments throughout the 2003-03-10 22:28:22 +00:00
page.h Update copyright to 2002. 2002-06-20 20:29:54 +00:00
pg_sema.h pgindent run. 2002-09-04 20:31:48 +00:00
pg_shmem.h pgindent run. 2002-09-04 20:31:48 +00:00
pmsignal.h pgindent run. 2002-09-04 20:31:48 +00:00
pos.h Update copyright to 2002. 2002-06-20 20:29:54 +00:00
proc.h Rename 'holder' references to 'proclock' for PROCLOCK references, for 2003-02-18 02:13:24 +00:00
relfilenode.h New pgindent run with fixes suggested by Tom. Patch manually reviewed, 2001-11-05 17:46:40 +00:00
s_lock.h TAS code originally written for s390 (32-bit) does not work for s390x 2002-11-22 01:13:16 +00:00
shmem.h [ Newest version of patch applied.] 2002-08-17 13:04:19 +00:00
sinval.h pgindent run. 2002-09-04 20:31:48 +00:00
sinvaladt.h This patch reserves the last superuser_reserved_connections slots for 2002-08-29 21:02:12 +00:00
smgr.h Restructure local-buffer handling per recent pghackers discussion. 2002-08-06 02:36:35 +00:00
spin.h Update copyright to 2002. 2002-06-20 20:29:54 +00:00