aboutsummaryrefslogtreecommitdiff
path: root/src/include/commands/tablecmds.h
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2015-03-03 14:10:50 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2015-03-03 14:10:50 -0300
commita2e35b53c39b2a27d3e332dc7c506539c306fd44 (patch)
tree1f4cd33208d33f4a8b3159b0d3757109c67d4b14 /src/include/commands/tablecmds.h
parent6f9d79904748c26a58991942dc6719db558f77b0 (diff)
downloadpostgresql-a2e35b53c39b2a27d3e332dc7c506539c306fd44.tar.gz
postgresql-a2e35b53c39b2a27d3e332dc7c506539c306fd44.zip
Change many routines to return ObjectAddress rather than OID
The changed routines are mostly those that can be directly called by ProcessUtilitySlow; the intention is to make the affected object information more precise, in support for future event trigger changes. Originally it was envisioned that the OID of the affected object would be enough, and in most cases that is correct, but upon actually implementing the event trigger changes it turned out that ObjectAddress is more widely useful. Additionally, some command execution routines grew an output argument that's an object address which provides further info about the executed command. To wit: * for ALTER DOMAIN / ADD CONSTRAINT, it corresponds to the address of the new constraint * for ALTER OBJECT / SET SCHEMA, it corresponds to the address of the schema that originally contained the object. * for ALTER EXTENSION {ADD, DROP} OBJECT, it corresponds to the address of the object added to or dropped from the extension. There's no user-visible change in this commit, and no functional change either. Discussion: 20150218213255.GC6717@tamriel.snowman.net Reviewed-By: Stephen Frost, Andres Freund
Diffstat (limited to 'src/include/commands/tablecmds.h')
-rw-r--r--src/include/commands/tablecmds.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h
index a55e8d42ee7..f269c635588 100644
--- a/src/include/commands/tablecmds.h
+++ b/src/include/commands/tablecmds.h
@@ -16,12 +16,14 @@
#include "access/htup.h"
#include "catalog/dependency.h"
+#include "catalog/objectaddress.h"
#include "nodes/parsenodes.h"
#include "storage/lock.h"
#include "utils/relcache.h"
-extern Oid DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId);
+extern ObjectAddress DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
+ ObjectAddress *typaddress);
extern void RemoveRelations(DropStmt *drop);
@@ -37,7 +39,8 @@ extern void AlterTableInternal(Oid relid, List *cmds, bool recurse);
extern Oid AlterTableMoveAll(AlterTableMoveAllStmt *stmt);
-extern Oid AlterTableNamespace(AlterObjectSchemaStmt *stmt);
+extern ObjectAddress AlterTableNamespace(AlterObjectSchemaStmt *stmt,
+ Oid *oldschema);
extern void AlterTableNamespaceInternal(Relation rel, Oid oldNspOid,
Oid nspOid, ObjectAddresses *objsMoved);
@@ -53,11 +56,13 @@ extern void ExecuteTruncate(TruncateStmt *stmt);
extern void SetRelationHasSubclass(Oid relationId, bool relhassubclass);
-extern Oid renameatt(RenameStmt *stmt);
+extern ObjectAddress renameatt(RenameStmt *stmt);
-extern Oid RenameConstraint(RenameStmt *stmt);
+extern ObjectAddress renameatt_type(RenameStmt *stmt);
-extern Oid RenameRelation(RenameStmt *stmt);
+extern ObjectAddress RenameConstraint(RenameStmt *stmt);
+
+extern ObjectAddress RenameRelation(RenameStmt *stmt);
extern void RenameRelationInternal(Oid myrelid,
const char *newrelname, bool is_internal);