postgresql/doc/src/sgml/ref
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
..
abort.sgml Augment the date/time examples in the User's Guide to reflect the newer 2002-04-21 19:02:39 +00:00
allfiles.sgml Todo items: 2003-03-20 07:02:11 +00:00
alter_database.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
alter_domain.sgml ALTER DOMAIN OWNER, from Rod Taylor. 2003-01-06 00:31:45 +00:00
alter_group.sgml Augment the date/time examples in the User's Guide to reflect the newer 2002-04-21 19:02:39 +00:00
alter_sequence.sgml Todo items: 2003-03-20 07:02:11 +00:00
alter_table.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
alter_trigger.sgml This patch implements FOR EACH STATEMENT triggers, per my email to 2002-11-23 03:59:09 +00:00
alter_user.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
analyze.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
begin.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
checkpoint.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
close.sgml Revise command completion tags as per hackers message on 20 March. 2002-05-18 15:44:48 +00:00
cluster.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
clusterdb.sgml Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
comment.sgml Second phase of committing Rod Taylor's pg_depend/pg_constraint patch. 2002-07-12 18:43:19 +00:00
commit.sgml Augment the date/time examples in the User's Guide to reflect the newer 2002-04-21 19:02:39 +00:00
copy.sgml This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
create_aggregate.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_cast.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_constraint.sgml Revise command completion tags as per hackers message on 20 March. 2002-05-18 15:44:48 +00:00
create_conversion.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_database.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_domain.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_function.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_group.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_index.sgml Add more appropriate markup. 2002-09-21 18:32:54 +00:00
create_language.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_opclass.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_operator.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_rule.sgml Fixups for man pages 2002-11-21 23:34:43 +00:00
create_schema.sgml Add mention of CURRENT_SCHEMA for object creation. 2003-02-03 15:56:50 +00:00
create_sequence.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_table_as.sgml Fixups for man pages 2002-11-21 23:34:43 +00:00
create_table.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_trigger.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_type.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_user.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
create_view.sgml Fixups for man pages 2002-11-21 23:34:43 +00:00
createdb.sgml Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
createlang.sgml Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
createuser.sgml Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
deallocate.sgml PREPARE/EXECUTE statements. Patch by Neil Conway, some kibitzing 2002-08-27 04:55:12 +00:00
declare.sgml This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
delete.sgml Update SQL-command reference pages for schema features. 2002-04-23 02:07:16 +00:00
drop_aggregate.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
drop_cast.sgml Create/drop cast now requires ownership of at least one of the types. 2002-08-11 17:44:12 +00:00
drop_conversion.sgml Add more appropriate markup. 2002-09-21 18:32:54 +00:00
drop_database.sgml Augment the date/time examples in the User's Guide to reflect the newer 2002-04-21 19:02:39 +00:00
drop_domain.sgml Fixups for man pages 2002-11-21 23:34:43 +00:00
drop_function.sgml Fixups for man pages 2002-11-21 23:34:43 +00:00
drop_group.sgml Augment the date/time examples in the User's Guide to reflect the newer 2002-04-21 19:02:39 +00:00
drop_index.sgml Second phase of committing Rod Taylor's pg_depend/pg_constraint patch. 2002-07-12 18:43:19 +00:00
drop_language.sgml Second phase of committing Rod Taylor's pg_depend/pg_constraint patch. 2002-07-12 18:43:19 +00:00
drop_opclass.sgml Add more appropriate markup. 2002-09-21 18:32:54 +00:00
drop_operator.sgml Implement CREATE/DROP OPERATOR CLASS. Work still remains: need more 2002-07-29 22:14:11 +00:00
drop_rule.sgml Second phase of committing Rod Taylor's pg_depend/pg_constraint patch. 2002-07-12 18:43:19 +00:00
drop_schema.sgml Implement DROP SCHEMA. It lacks support for dropping conversions and 2002-07-18 16:47:26 +00:00
drop_sequence.sgml Fix copy-and-pasteo (CASCADE/RESTRICT in wrong place). 2002-07-18 15:49:08 +00:00
drop_table.sgml Remove no-longer-appropriate notes about lack of CASCADE/RESTRICT behavior. 2002-07-14 22:47:56 +00:00
drop_trigger.sgml Fixups for man pages 2002-11-21 23:34:43 +00:00
drop_type.sgml Fixups for man pages 2002-11-21 23:34:43 +00:00
drop_user.sgml Some cleanups in CREATE/ALTER/DROP USER ref pages. 2002-02-27 21:14:54 +00:00
drop_view.sgml Fixups for man pages 2002-11-21 23:34:43 +00:00
dropdb.sgml Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
droplang.sgml Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
dropuser.sgml Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
ecpg-ref.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
end.sgml Augment the date/time examples in the User's Guide to reflect the newer 2002-04-21 19:02:39 +00:00
execute.sgml Implement EXPLAIN EXECUTE. By Neil Conway, with some kibitzing from 2003-02-02 23:46:38 +00:00
explain.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
fetch.sgml This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
grant.sgml Grant options, and cascading revoke. Grant options are allowed only for 2003-01-23 23:39:07 +00:00
initdb.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
initlocation.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
insert.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
ipcclean.sgml Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
listen.sgml Add more appropriate markup. 2002-09-21 18:32:54 +00:00
load.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
lock.sgml Add more appropriate markup. 2002-09-21 18:32:54 +00:00
move.sgml This patch implements holdable cursors, following the proposal 2003-03-27 16:51:29 +00:00
notify.sgml Add more appropriate markup. 2002-09-21 18:32:54 +00:00
pg_config-ref.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
pg_controldata.sgml Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
pg_ctl-ref.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
pg_dump.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
pg_dumpall.sgml Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
pg_resetxlog.sgml Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
pg_restore.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
pgtclsh.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
pgtksh.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
postgres-ref.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
postmaster.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
prepare.sgml Restructure parsetree representation of DECLARE CURSOR: now it's a 2003-03-10 03:53:52 +00:00
psql-ref.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
reindex.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
reset.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
revoke.sgml Grant options, and cascading revoke. Grant options are allowed only for 2003-01-23 23:39:07 +00:00
rollback.sgml Revise command completion tags as per hackers message on 20 March. 2002-05-18 15:44:48 +00:00
select_into.sgml Fixups for man pages 2002-11-21 23:34:43 +00:00
select.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
set_constraints.sgml Improve documentation of trigger firing queue handling, cleanup. 2002-08-17 12:15:49 +00:00
set_session_auth.sgml This patch makes the following changes to the documentation: 2003-02-19 04:06:28 +00:00
set_transaction.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
set.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
show.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
start_transaction.sgml Read-only transactions, as defined in SQL. 2003-01-10 22:03:30 +00:00
truncate.sgml With a recent commit truncate is transaction safe in 7.4. 2002-12-06 03:15:07 +00:00
unlisten.sgml Add more appropriate markup. 2002-09-21 18:32:54 +00:00
update.sgml > Neil Conway <nconway@klamath.dyndns.org> writes: 2002-08-15 02:59:18 +00:00
vacuum.sgml Merge documentation into one book. (Build with "make html".) Replace 2003-03-25 16:15:44 +00:00
vacuumdb.sgml Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00