diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-08-12 02:52:06 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-08-12 02:52:06 +0000 |
commit | 7a3e30e608a25800a1f7fdfaaca4da3f0ac0fb07 (patch) | |
tree | 215adabe95d76123f6120fc22e4b51b5a1baf4cd /src/include/utils/portal.h | |
parent | 5c9e9c0c42904648af5a03fe90db8050e31d603f (diff) | |
download | postgresql-7a3e30e608a25800a1f7fdfaaca4da3f0ac0fb07.tar.gz postgresql-7a3e30e608a25800a1f7fdfaaca4da3f0ac0fb07.zip |
Add INSERT/UPDATE/DELETE RETURNING, with basic docs and regression tests.
plpgsql support to come later. Along the way, convert execMain's
SELECT INTO support into a DestReceiver, in order to eliminate some ugly
special cases.
Jonah Harris and Tom Lane
Diffstat (limited to 'src/include/utils/portal.h')
-rw-r--r-- | src/include/utils/portal.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/include/utils/portal.h b/src/include/utils/portal.h index 3704240ff50..3f308f5f582 100644 --- a/src/include/utils/portal.h +++ b/src/include/utils/portal.h @@ -39,7 +39,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/portal.h,v 1.64 2006/08/08 01:23:15 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/portal.h,v 1.65 2006/08/12 02:52:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -62,6 +62,12 @@ * supports holdable cursors (the Executor results can be dumped into a * tuplestore for access after transaction completion). * + * PORTAL_ONE_RETURNING: the portal contains a single INSERT/UPDATE/DELETE + * query with a RETURNING clause. On first execution, we run the statement + * and dump its results into the portal tuplestore; the results are then + * returned to the client as demanded. (We can't support suspension of + * the query partway through, because the AFTER TRIGGER code can't cope.) + * * PORTAL_UTIL_SELECT: the portal contains a utility statement that returns * a SELECT-like result (for example, EXPLAIN or SHOW). On first execution, * we run the statement and dump its results into the portal tuplestore; @@ -73,6 +79,7 @@ typedef enum PortalStrategy { PORTAL_ONE_SELECT, + PORTAL_ONE_RETURNING, PORTAL_UTIL_SELECT, PORTAL_MULTI_QUERY } PortalStrategy; @@ -133,7 +140,6 @@ typedef struct PortalData /* Status data */ PortalStatus status; /* see above */ - bool portalUtilReady; /* PortalRunUtility complete? */ /* If not NULL, Executor is active; call ExecutorEnd eventually: */ QueryDesc *queryDesc; /* info needed for executor invocation */ @@ -144,9 +150,9 @@ typedef struct PortalData int16 *formats; /* a format code for each column */ /* - * Where we store tuples for a held cursor or a PORTAL_UTIL_SELECT query. - * (A cursor held past the end of its transaction no longer has any active - * executor state.) + * Where we store tuples for a held cursor or a PORTAL_ONE_RETURNING or + * PORTAL_UTIL_SELECT query. (A cursor held past the end of its + * transaction no longer has any active executor state.) */ Tuplestorestate *holdStore; /* store for holdable cursors */ MemoryContext holdContext; /* memory containing holdStore */ |