aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/heap.h4
-rw-r--r--src/include/commands/tablecmds.h30
-rw-r--r--src/include/nodes/parsenodes.h14
3 files changed, 19 insertions, 29 deletions
diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h
index 74abf47bc77..677347c24f5 100644
--- a/src/include/catalog/heap.h
+++ b/src/include/catalog/heap.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: heap.h,v 1.58 2002/11/09 23:56:39 momjian Exp $
+ * $Id: heap.h,v 1.59 2002/11/11 22:19:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -41,7 +41,7 @@ extern Oid heap_create_with_catalog(const char *relname,
TupleDesc tupdesc,
char relkind,
bool shared_relation,
- char ateoxact,
+ OnCommitAction oncommit,
bool allow_system_table_mods);
extern void heap_drop_with_catalog(Oid rid);
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h
index 329f0989dd9..13873dad1b5 100644
--- a/src/include/commands/tablecmds.h
+++ b/src/include/commands/tablecmds.h
@@ -7,14 +7,13 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: tablecmds.h,v 1.9 2002/11/09 23:56:39 momjian Exp $
+ * $Id: tablecmds.h,v 1.10 2002/11/11 22:19:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef TABLECMDS_H
#define TABLECMDS_H
-#include "access/htup.h"
#include "nodes/parsenodes.h"
extern void AlterTableAddColumn(Oid myrelid, bool recurse, ColumnDef *colDef);
@@ -63,29 +62,10 @@ extern void renameatt(Oid myrelid,
extern void renamerel(Oid myrelid,
const char *newrelname);
-/*
- * Temp rel stuff
- */
-typedef struct TempTable
-{
- Oid relid; /* relid of temp relation */
- char ateoxact; /* what to do at end of xact */
- TransactionId tid; /* trans id where in rel was created */
- bool dead; /* table was dropped in the current xact */
-} TempTable;
-
-extern void AtEOXact_temp_relations(bool iscommit, int bstate);
-extern void reg_temp_rel(TempTable *t);
-extern void free_temp_rels(void);
-extern void rm_temp_rel(Oid relid);
-
-/*
- * What to do at commit time for temporary relations
- */
+extern void register_on_commit_action(Oid relid, OnCommitAction action);
+extern void remove_on_commit_action(Oid relid);
-#define ATEOXACTNOOP 0 /* no operation at commit */
-#define ATEOXACTPRESERVE 1 /* preserve rows */
-#define ATEOXACTDELETE 2 /* delete rows */
-#define ATEOXACTDROP 3 /* drop temp table */
+extern void PreCommit_on_commit_actions(void);
+extern void AtEOXact_on_commit_actions(bool isCommit);
#endif /* TABLECMDS_H */
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;
/* ----------