summaryrefslogtreecommitdiff
path: root/src/include/nodes/parsenodes.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-11-11 22:19:25 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-11-11 22:19:25 +0000
commitf9b5b41ef993a9b76b7f97b271df8034f1a24154 (patch)
treeddd95da1ffa8ce1fee1ebc807822d6cc67cd8cdd /src/include/nodes/parsenodes.h
parent1b342df00af318055a1cf432c3eaa3b74347df39 (diff)
Code review for ON COMMIT patch. Make the actual on-commit action happen
before commit, not after :-( --- the original coding is not only unsafe if an error occurs while it's processing, but it generates an invalid sequence of WAL entries. Resurrect 7.2 logic for deleting items when no longer needed. Use an enum instead of random macros. Editorialize on names used for routines and constants. Teach backend/nodes routines about new field in CreateTable struct. Add a regression test.
Diffstat (limited to 'src/include/nodes/parsenodes.h')
-rw-r--r--src/include/nodes/parsenodes.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 210acd86edd..7554f00361d 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: parsenodes.h,v 1.211 2002/11/09 23:56:39 momjian Exp $
+ * $Id: parsenodes.h,v 1.212 2002/11/11 22:19:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -911,6 +911,16 @@ typedef struct CopyStmt
* implementation).
* ----------------------
*/
+
+/* What to do at commit time for temporary relations */
+typedef enum OnCommitAction
+{
+ ONCOMMIT_NOOP, /* No ON COMMIT clause (do nothing) */
+ ONCOMMIT_PRESERVE_ROWS, /* ON COMMIT PRESERVE ROWS (do nothing) */
+ ONCOMMIT_DELETE_ROWS, /* ON COMMIT DELETE ROWS */
+ ONCOMMIT_DROP /* ON COMMIT DROP */
+} OnCommitAction;
+
typedef struct CreateStmt
{
NodeTag type;
@@ -919,7 +929,7 @@ typedef struct CreateStmt
List *inhRelations; /* relations to inherit from */
List *constraints; /* constraints (list of Constraint nodes) */
bool hasoids; /* should it have OIDs? */
- char ateoxact; /* what do we do at COMMIT for TEMP ? */
+ OnCommitAction oncommit; /* what do we do at COMMIT? */
} CreateStmt;
/* ----------