mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
Add code to handle [ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP }]
for temp tables. Gavin Sherry
This commit is contained in:
@@ -7,13 +7,14 @@
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: tablecmds.h,v 1.8 2002/10/21 20:31:52 momjian Exp $
|
||||
* $Id: tablecmds.h,v 1.9 2002/11/09 23:56:39 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef TABLECMDS_H
|
||||
#define TABLECMDS_H
|
||||
|
||||
#include "access/htup.h"
|
||||
#include "nodes/parsenodes.h"
|
||||
|
||||
extern void AlterTableAddColumn(Oid myrelid, bool recurse, ColumnDef *colDef);
|
||||
@@ -62,4 +63,29 @@ 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
|
||||
*/
|
||||
|
||||
#define ATEOXACTNOOP 0 /* no operation at commit */
|
||||
#define ATEOXACTPRESERVE 1 /* preserve rows */
|
||||
#define ATEOXACTDELETE 2 /* delete rows */
|
||||
#define ATEOXACTDROP 3 /* drop temp table */
|
||||
|
||||
#endif /* TABLECMDS_H */
|
||||
|
||||
Reference in New Issue
Block a user