OSDN Git Service

d9e1a56372850c89014d732234f5859ca9ec47ab
[pg-rex/syncrep.git] / src / include / commands / tablecmds.h
1 /*-------------------------------------------------------------------------
2  *
3  * tablecmds.h
4  *        prototypes for tablecmds.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $PostgreSQL: pgsql/src/include/commands/tablecmds.h,v 1.40 2008/06/15 01:25:54 tgl Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef TABLECMDS_H
15 #define TABLECMDS_H
16
17 #include "nodes/parsenodes.h"
18 #include "utils/rel.h"
19
20
21 extern Oid      DefineRelation(CreateStmt *stmt, char relkind);
22
23 extern void RemoveRelations(DropStmt *drop);
24
25 extern void AlterTable(AlterTableStmt *stmt);
26
27 extern void ATExecChangeOwner(Oid relationOid, Oid newOwnerId, bool recursing);
28
29 extern void AlterTableInternal(Oid relid, List *cmds, bool recurse);
30
31 extern void AlterTableNamespace(RangeVar *relation, const char *newschema,
32                                                                 ObjectType stmttype);
33
34 extern void AlterRelationNamespaceInternal(Relation classRel, Oid relOid,
35                                                            Oid oldNspOid, Oid newNspOid,
36                                                            bool hasDependEntry);
37
38 extern void CheckTableNotInUse(Relation rel, const char *stmt);
39
40 extern void ExecuteTruncate(TruncateStmt *stmt);
41
42 extern void renameatt(Oid myrelid,
43                   const char *oldattname,
44                   const char *newattname,
45                   bool recurse,
46                   bool recursing);
47
48 extern void RenameRelation(Oid myrelid,
49                   const char *newrelname,
50                   ObjectType reltype);
51
52 extern void RenameRelationInternal(Oid myrelid,
53                   const char *newrelname,
54                   Oid namespaceId);
55
56 extern void find_composite_type_dependencies(Oid typeOid,
57                                                                  const char *origTblName,
58                                                                  const char *origTypeName);
59
60 extern AttrNumber *varattnos_map(TupleDesc old, TupleDesc new);
61 extern AttrNumber *varattnos_map_schema(TupleDesc old, List *schema);
62 extern void change_varattnos_of_a_node(Node *node, const AttrNumber *newattno);
63
64 extern void register_on_commit_action(Oid relid, OnCommitAction action);
65 extern void remove_on_commit_action(Oid relid);
66
67 extern void PreCommit_on_commit_actions(void);
68 extern void AtEOXact_on_commit_actions(bool isCommit);
69 extern void AtEOSubXact_on_commit_actions(bool isCommit,
70                                                           SubTransactionId mySubid,
71                                                           SubTransactionId parentSubid);
72
73 #endif   /* TABLECMDS_H */