mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
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
This commit is contained in:
@ -15,6 +15,7 @@
|
||||
#define DBCOMMANDS_H
|
||||
|
||||
#include "access/xlogreader.h"
|
||||
#include "catalog/objectaddress.h"
|
||||
#include "lib/stringinfo.h"
|
||||
#include "nodes/parsenodes.h"
|
||||
|
||||
@ -40,10 +41,10 @@ typedef struct xl_dbase_drop_rec
|
||||
|
||||
extern Oid createdb(const CreatedbStmt *stmt);
|
||||
extern void dropdb(const char *dbname, bool missing_ok);
|
||||
extern Oid RenameDatabase(const char *oldname, const char *newname);
|
||||
extern ObjectAddress RenameDatabase(const char *oldname, const char *newname);
|
||||
extern Oid AlterDatabase(AlterDatabaseStmt *stmt, bool isTopLevel);
|
||||
extern Oid AlterDatabaseSet(AlterDatabaseSetStmt *stmt);
|
||||
extern Oid AlterDatabaseOwner(const char *dbname, Oid newOwnerId);
|
||||
extern ObjectAddress AlterDatabaseOwner(const char *dbname, Oid newOwnerId);
|
||||
|
||||
extern Oid get_database_oid(const char *dbname, bool missingok);
|
||||
extern char *get_database_name(Oid dbid);
|
||||
|
Reference in New Issue
Block a user