diff options
| author | Robert Haas | 2012-12-23 23:25:03 +0000 |
|---|---|---|
| committer | Robert Haas | 2012-12-23 23:37:58 +0000 |
| commit | c504513f83a9ee8dce4a719746ca73102cae9f13 (patch) | |
| tree | 3664999ca3242003181bef1fa171e28fe557ecb9 /src/backend/commands/extension.c | |
| parent | 31bc839724439440b2e94ea616b28ce5be94e19c (diff) | |
Adjust many backend functions to return OID rather than void.
Extracted from a larger patch by Dimitri Fontaine. It is hoped that
this will provide infrastructure for enriching the new event trigger
functionality, but it seems possibly useful for other purposes as
well.
Diffstat (limited to 'src/backend/commands/extension.c')
| -rw-r--r-- | src/backend/commands/extension.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c index 3b8e22425ca..ad072a5c7b0 100644 --- a/src/backend/commands/extension.c +++ b/src/backend/commands/extension.c @@ -1174,7 +1174,7 @@ find_update_path(List *evi_list, /* * CREATE EXTENSION */ -void +Oid CreateExtension(CreateExtensionStmt *stmt) { DefElem *d_schema = NULL; @@ -1210,7 +1210,7 @@ CreateExtension(CreateExtensionStmt *stmt) (errcode(ERRCODE_DUPLICATE_OBJECT), errmsg("extension \"%s\" already exists, skipping", stmt->extname))); - return; + return InvalidOid; } else ereport(ERROR, @@ -1470,6 +1470,8 @@ CreateExtension(CreateExtensionStmt *stmt) */ ApplyExtensionUpdates(extensionOid, pcontrol, versionName, updateVersions); + + return extensionOid; } /* @@ -2398,7 +2400,7 @@ extension_config_remove(Oid extensionoid, Oid tableoid) /* * Execute ALTER EXTENSION SET SCHEMA */ -void +Oid AlterExtensionNamespace(List *names, const char *newschema) { char *extensionName; @@ -2479,7 +2481,7 @@ AlterExtensionNamespace(List *names, const char *newschema) if (extForm->extnamespace == nspOid) { heap_close(extRel, RowExclusiveLock); - return; + return InvalidOid; } /* Check extension is supposed to be relocatable */ @@ -2571,6 +2573,8 @@ AlterExtensionNamespace(List *names, const char *newschema) /* update dependencies to point to the new schema */ changeDependencyFor(ExtensionRelationId, extensionOid, NamespaceRelationId, oldNspOid, nspOid); + + return extensionOid; } /* |
