PostgreSQL Source Code  git master
tablecmds.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * tablecmds.h
4  * prototypes for tablecmds.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/commands/tablecmds.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef TABLECMDS_H
15 #define TABLECMDS_H
16 
17 #include "access/htup.h"
18 #include "catalog/dependency.h"
19 #include "catalog/objectaddress.h"
20 #include "nodes/parsenodes.h"
21 #include "catalog/partition.h"
22 #include "storage/lock.h"
23 #include "utils/relcache.h"
24 
25 
26 extern ObjectAddress DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
27  ObjectAddress *typaddress, const char *queryString);
28 
29 extern void RemoveRelations(DropStmt *drop);
30 
31 extern Oid AlterTableLookupRelation(AlterTableStmt *stmt, LOCKMODE lockmode);
32 
33 extern void AlterTable(Oid relid, LOCKMODE lockmode, AlterTableStmt *stmt);
34 
36 
37 extern void ATExecChangeOwner(Oid relationOid, Oid newOwnerId, bool recursing, LOCKMODE lockmode);
38 
39 extern void AlterTableInternal(Oid relid, List *cmds, bool recurse);
40 
42 
44  Oid *oldschema);
45 
46 extern void AlterTableNamespaceInternal(Relation rel, Oid oldNspOid,
47  Oid nspOid, ObjectAddresses *objsMoved);
48 
49 extern void AlterRelationNamespaceInternal(Relation classRel, Oid relOid,
50  Oid oldNspOid, Oid newNspOid,
51  bool hasDependEntry,
52  ObjectAddresses *objsMoved);
53 
54 extern void CheckTableNotInUse(Relation rel, const char *stmt);
55 
56 extern void ExecuteTruncate(TruncateStmt *stmt);
57 
58 extern void SetRelationHasSubclass(Oid relationId, bool relhassubclass);
59 
60 extern ObjectAddress renameatt(RenameStmt *stmt);
61 
63 
65 
67 
68 extern void RenameRelationInternal(Oid myrelid,
69  const char *newrelname, bool is_internal);
70 
71 extern void find_composite_type_dependencies(Oid typeOid,
72  Relation origRelation,
73  const char *origTypeName);
74 
75 extern void check_of_type(HeapTuple typetuple);
76 
78 extern void remove_on_commit_action(Oid relid);
79 
80 extern void PreCommit_on_commit_actions(void);
81 extern void AtEOXact_on_commit_actions(bool isCommit);
82 extern void AtEOSubXact_on_commit_actions(bool isCommit,
83  SubTransactionId mySubid,
84  SubTransactionId parentSubid);
85 
86 extern void RangeVarCallbackOwnsTable(const RangeVar *relation,
87  Oid relId, Oid oldRelId, void *arg);
88 
89 extern void RangeVarCallbackOwnsRelation(const RangeVar *relation,
90  Oid relId, Oid oldRelId, void *noCatalogs);
92  List *partConstraint);
93 
94 #endif /* TABLECMDS_H */
bool PartConstraintImpliedByRelConstraint(Relation scanrel, List *partConstraint)
Definition: tablecmds.c:13628
ObjectAddress renameatt_type(RenameStmt *stmt)
void find_composite_type_dependencies(Oid typeOid, Relation origRelation, const char *origTypeName)
Definition: tablecmds.c:4944
void remove_on_commit_action(Oid relid)
Definition: tablecmds.c:12957
int LOCKMODE
Definition: lockdefs.h:26
void AlterTable(Oid relid, LOCKMODE lockmode, AlterTableStmt *stmt)
Definition: tablecmds.c:3142
void AtEOXact_on_commit_actions(bool isCommit)
Definition: tablecmds.c:13051
ObjectAddress RenameRelation(RenameStmt *stmt)
Definition: tablecmds.c:2923
ObjectAddress RenameConstraint(RenameStmt *stmt)
Definition: tablecmds.c:2872
uint32 SubTransactionId
Definition: c.h:459
unsigned int Oid
Definition: postgres_ext.h:31
LOCKMODE AlterTableGetLockLevel(List *cmds)
Definition: tablecmds.c:3211
void SetRelationHasSubclass(Oid relationId, bool relhassubclass)
Definition: tablecmds.c:2489
OnCommitAction
Definition: primnodes.h:47
ObjectAddress AlterTableNamespace(AlterObjectSchemaStmt *stmt, Oid *oldschema)
Definition: tablecmds.c:12617
void RangeVarCallbackOwnsTable(const RangeVar *relation, Oid relId, Oid oldRelId, void *arg)
Definition: tablecmds.c:13138
void AlterRelationNamespaceInternal(Relation classRel, Oid relOid, Oid oldNspOid, Oid newNspOid, bool hasDependEntry, ObjectAddresses *objsMoved)
Definition: tablecmds.c:12726
void ATExecChangeOwner(Oid relationOid, Oid newOwnerId, bool recursing, LOCKMODE lockmode)
Definition: tablecmds.c:9993
void AlterTableNamespaceInternal(Relation rel, Oid oldNspOid, Oid nspOid, ObjectAddresses *objsMoved)
Definition: tablecmds.c:12688
void CheckTableNotInUse(Relation rel, const char *stmt)
Definition: tablecmds.c:3063
void RangeVarCallbackOwnsRelation(const RangeVar *relation, Oid relId, Oid oldRelId, void *noCatalogs)
Definition: tablecmds.c:13171
ObjectAddress DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, ObjectAddress *typaddress, const char *queryString)
Definition: tablecmds.c:505
Oid AlterTableLookupRelation(AlterTableStmt *stmt, LOCKMODE lockmode)
Definition: tablecmds.c:3092
void AlterTableInternal(Oid relid, List *cmds, bool recurse)
Definition: tablecmds.c:3166
ObjectAddress renameatt(RenameStmt *stmt)
Definition: tablecmds.c:2735
void check_of_type(HeapTuple typetuple)
Definition: tablecmds.c:5109
Oid AlterTableMoveAll(AlterTableMoveAllStmt *stmt)
Definition: tablecmds.c:10804
void RemoveRelations(DropStmt *drop)
Definition: tablecmds.c:1007
void * arg
void register_on_commit_action(Oid relid, OnCommitAction action)
Definition: tablecmds.c:12926
void AtEOSubXact_on_commit_actions(bool isCommit, SubTransactionId mySubid, SubTransactionId parentSubid)
Definition: tablecmds.c:13093
Definition: pg_list.h:45
void PreCommit_on_commit_actions(void)
Definition: tablecmds.c:12980
void ExecuteTruncate(TruncateStmt *stmt)
Definition: tablecmds.c:1248
void RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal)
Definition: tablecmds.c:2967