diff options
author | Robert Haas | 2012-12-29 12:55:37 +0000 |
---|---|---|
committer | Robert Haas | 2012-12-29 12:55:37 +0000 |
commit | 82b1b213cad3a69cf5f3dfaa81687c14366960fc (patch) | |
tree | e19129f124c02d7ef274393d584de97cc18a5f66 /src/backend/commands/tablespace.c | |
parent | 5ab3af46ddd2f2c2b248f1ffdb688b394d4bb387 (diff) |
Adjust more backend functions to return OID rather than void.
This is again intended to support extensions to the event trigger
functionality. This may go a bit further than we need for that
purpose, but there's some value in being consistent, and the OID
may be useful for other purposes also.
Dimitri Fontaine
Diffstat (limited to 'src/backend/commands/tablespace.c')
-rw-r--r-- | src/backend/commands/tablespace.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index 2c19db31e0d..c5d13a5854e 100644 --- a/src/backend/commands/tablespace.c +++ b/src/backend/commands/tablespace.c @@ -222,7 +222,7 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo) * since we're determining the system layout and, anyway, we probably have * root if we're doing this kind of activity */ -void +Oid CreateTableSpace(CreateTableSpaceStmt *stmt) { #ifdef HAVE_SYMLINK @@ -371,6 +371,8 @@ CreateTableSpace(CreateTableSpaceStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("tablespaces are not supported on this platform"))); #endif /* HAVE_SYMLINK */ + + return tablespaceoid; } /* @@ -890,13 +892,14 @@ RenameTableSpace(const char *oldname, const char *newname) /* * Alter table space options */ -void +Oid AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt) { Relation rel; ScanKeyData entry[1]; HeapScanDesc scandesc; HeapTuple tup; + Oid tablespaceoid; Datum datum; Datum newOptions; Datum repl_val[Natts_pg_tablespace]; @@ -920,6 +923,8 @@ AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt) errmsg("tablespace \"%s\" does not exist", stmt->tablespacename))); + tablespaceoid = HeapTupleGetOid(tup); + /* Must be owner of the existing object */ if (!pg_tablespace_ownercheck(HeapTupleGetOid(tup), GetUserId())) aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_TABLESPACE, @@ -952,6 +957,8 @@ AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt) /* Conclude heap scan. */ heap_endscan(scandesc); heap_close(rel, NoLock); + + return tablespaceoid; } /* |