]> granicus.if.org Git - postgresql/commitdiff
Adjust many backend functions to return OID rather than void.
authorRobert Haas <rhaas@postgresql.org>
Sun, 23 Dec 2012 23:25:03 +0000 (18:25 -0500)
committerRobert Haas <rhaas@postgresql.org>
Sun, 23 Dec 2012 23:37:58 +0000 (18:37 -0500)
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.

39 files changed:
src/backend/catalog/pg_aggregate.c
src/backend/catalog/pg_operator.c
src/backend/commands/aggregatecmds.c
src/backend/commands/alter.c
src/backend/commands/collationcmds.c
src/backend/commands/conversioncmds.c
src/backend/commands/dbcommands.c
src/backend/commands/event_trigger.c
src/backend/commands/extension.c
src/backend/commands/foreigncmds.c
src/backend/commands/functioncmds.c
src/backend/commands/opclasscmds.c
src/backend/commands/operatorcmds.c
src/backend/commands/proclang.c
src/backend/commands/schemacmds.c
src/backend/commands/sequence.c
src/backend/commands/tablecmds.c
src/backend/commands/tablespace.c
src/backend/commands/trigger.c
src/backend/commands/tsearchcmds.c
src/backend/commands/typecmds.c
src/backend/commands/user.c
src/backend/commands/view.c
src/include/catalog/pg_operator.h
src/include/commands/alter.h
src/include/commands/collationcmds.h
src/include/commands/conversioncmds.h
src/include/commands/dbcommands.h
src/include/commands/defrem.h
src/include/commands/extension.h
src/include/commands/proclang.h
src/include/commands/schemacmds.h
src/include/commands/sequence.h
src/include/commands/tablecmds.h
src/include/commands/tablespace.h
src/include/commands/trigger.h
src/include/commands/typecmds.h
src/include/commands/user.h
src/include/commands/view.h

index 2e12c5a3d542506fb9b9cfe2826c8155771c712d..c9449f81e10b57659a7c4724f185b0af5760cd4f 100644 (file)
@@ -42,7 +42,7 @@ static Oid lookup_agg_function(List *fnName, int nargs, Oid *input_types,
 /*
  * AggregateCreate
  */
-void
+Oid
 AggregateCreate(const char *aggName,
                                Oid aggNamespace,
                                Oid *aggArgTypes,
@@ -316,6 +316,8 @@ AggregateCreate(const char *aggName,
                referenced.objectSubId = 0;
                recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
        }
+
+       return procOid;
 }
 
 /*
index 88af345fab9cdb0c4f4ba0b5368b0c407e411277..47830dc3e6ed044cb1feb1f25225c44cf23226b6 100644 (file)
@@ -326,7 +326,7 @@ OperatorShellMake(const char *operatorName,
  * Forward declaration is used only for this purpose, it is
  * not available to the user as it is for type definition.
  */
-void
+Oid
 OperatorCreate(const char *operatorName,
                           Oid operatorNamespace,
                           Oid leftTypeId,
@@ -565,6 +565,8 @@ OperatorCreate(const char *operatorName,
 
        if (OidIsValid(commutatorId) || OidIsValid(negatorId))
                OperatorUpd(operatorObjectId, commutatorId, negatorId);
+
+       return operatorObjectId;
 }
 
 /*
index b9f871182fa54aa03a9f63dcbca7a5790a1e34fc..67a29d19fc16ba09bb6e8ec1a829047fe88fabcd 100644 (file)
@@ -46,7 +46,7 @@
  * is specified by a BASETYPE element in the parameters.  Otherwise,
  * "args" defines the input type(s).
  */
-void
+Oid
 DefineAggregate(List *name, List *args, bool oldstyle, List *parameters)
 {
        char       *aggName;
@@ -216,15 +216,15 @@ DefineAggregate(List *name, List *args, bool oldstyle, List *parameters)
        /*
         * Most of the argument-checking is done inside of AggregateCreate
         */
-       AggregateCreate(aggName,        /* aggregate name */
-                                       aggNamespace,           /* namespace */
-                                       aggArgTypes,    /* input data type(s) */
-                                       numArgs,
-                                       transfuncName,          /* step function name */
-                                       finalfuncName,          /* final function name */
-                                       sortoperatorName,       /* sort operator name */
-                                       transTypeId,    /* transition data type */
-                                       initval);       /* initial condition */
+       return AggregateCreate(aggName, /* aggregate name */
+                                                  aggNamespace,                /* namespace */
+                                                  aggArgTypes, /* input data type(s) */
+                                                  numArgs,
+                                                  transfuncName,               /* step function name */
+                                                  finalfuncName,               /* final function name */
+                                                  sortoperatorName,    /* sort operator name */
+                                                  transTypeId, /* transition data type */
+                                                  initval);    /* initial condition */
 }
 
 
@@ -232,7 +232,7 @@ DefineAggregate(List *name, List *args, bool oldstyle, List *parameters)
  * RenameAggregate
  *             Rename an aggregate.
  */
-void
+Oid
 RenameAggregate(List *name, List *args, const char *newname)
 {
        Oid                     procOid;
@@ -286,4 +286,6 @@ RenameAggregate(List *name, List *args, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return procOid;
 }
index 9e271c3e596b1d48e0f32b0ad921383a8b46897d..d8555ed4c7f3a8fce561966d4d538862dce2a443 100644 (file)
  * Executes an ALTER OBJECT / RENAME TO statement.     Based on the object
  * type, the function appropriate to that type is executed.
  */
-void
+Oid
 ExecRenameStmt(RenameStmt *stmt)
 {
        switch (stmt->renameType)
        {
                case OBJECT_AGGREGATE:
-                       RenameAggregate(stmt->object, stmt->objarg, stmt->newname);
-                       break;
+                       return RenameAggregate(stmt->object, stmt->objarg, stmt->newname);
 
                case OBJECT_COLLATION:
-                       RenameCollation(stmt->object, stmt->newname);
-                       break;
+                       return RenameCollation(stmt->object, stmt->newname);
 
                case OBJECT_CONSTRAINT:
-                       RenameConstraint(stmt);
-                       break;
+                       return RenameConstraint(stmt);
 
                case OBJECT_CONVERSION:
-                       RenameConversion(stmt->object, stmt->newname);
-                       break;
+                       return RenameConversion(stmt->object, stmt->newname);
 
                case OBJECT_DATABASE:
-                       RenameDatabase(stmt->subname, stmt->newname);
-                       break;
+                       return RenameDatabase(stmt->subname, stmt->newname);
 
                case OBJECT_FDW:
-                       RenameForeignDataWrapper(stmt->subname, stmt->newname);
-                       break;
+                       return RenameForeignDataWrapper(stmt->subname, stmt->newname);
 
                case OBJECT_FOREIGN_SERVER:
-                       RenameForeignServer(stmt->subname, stmt->newname);
-                       break;
+                       return RenameForeignServer(stmt->subname, stmt->newname);
 
                case OBJECT_EVENT_TRIGGER:
-                       RenameEventTrigger(stmt->subname, stmt->newname);
-                       break;
+                       return RenameEventTrigger(stmt->subname, stmt->newname);
 
                case OBJECT_FUNCTION:
-                       RenameFunction(stmt->object, stmt->objarg, stmt->newname);
-                       break;
+                       return RenameFunction(stmt->object, stmt->objarg, stmt->newname);
 
                case OBJECT_LANGUAGE:
-                       RenameLanguage(stmt->subname, stmt->newname);
-                       break;
+                       return RenameLanguage(stmt->subname, stmt->newname);
 
                case OBJECT_OPCLASS:
-                       RenameOpClass(stmt->object, stmt->subname, stmt->newname);
-                       break;
+                       return RenameOpClass(stmt->object, stmt->subname, stmt->newname);
 
                case OBJECT_OPFAMILY:
-                       RenameOpFamily(stmt->object, stmt->subname, stmt->newname);
-                       break;
+                       return RenameOpFamily(stmt->object, stmt->subname, stmt->newname);
 
                case OBJECT_ROLE:
-                       RenameRole(stmt->subname, stmt->newname);
-                       break;
+                       return RenameRole(stmt->subname, stmt->newname);
 
                case OBJECT_SCHEMA:
-                       RenameSchema(stmt->subname, stmt->newname);
-                       break;
+                       return RenameSchema(stmt->subname, stmt->newname);
 
                case OBJECT_TABLESPACE:
-                       RenameTableSpace(stmt->subname, stmt->newname);
-                       break;
+                       return RenameTableSpace(stmt->subname, stmt->newname);
 
                case OBJECT_TABLE:
                case OBJECT_SEQUENCE:
                case OBJECT_VIEW:
                case OBJECT_INDEX:
                case OBJECT_FOREIGN_TABLE:
-                       RenameRelation(stmt);
-                       break;
+                       return RenameRelation(stmt);
 
                case OBJECT_COLUMN:
                case OBJECT_ATTRIBUTE:
-                       renameatt(stmt);
-                       break;
+                       return renameatt(stmt);
 
                case OBJECT_TRIGGER:
-                       renametrig(stmt);
-                       break;
+                       return renametrig(stmt);
 
                case OBJECT_TSPARSER:
-                       RenameTSParser(stmt->object, stmt->newname);
-                       break;
+                       return RenameTSParser(stmt->object, stmt->newname);
 
                case OBJECT_TSDICTIONARY:
-                       RenameTSDictionary(stmt->object, stmt->newname);
-                       break;
+                       return RenameTSDictionary(stmt->object, stmt->newname);
 
                case OBJECT_TSTEMPLATE:
-                       RenameTSTemplate(stmt->object, stmt->newname);
-                       break;
+                       return RenameTSTemplate(stmt->object, stmt->newname);
 
                case OBJECT_TSCONFIGURATION:
-                       RenameTSConfiguration(stmt->object, stmt->newname);
-                       break;
+                       return RenameTSConfiguration(stmt->object, stmt->newname);
 
                case OBJECT_DOMAIN:
                case OBJECT_TYPE:
-                       RenameType(stmt);
-                       break;
+                       return RenameType(stmt);
 
                default:
                        elog(ERROR, "unrecognized rename stmt type: %d",
                                 (int) stmt->renameType);
+                       return InvalidOid;                      /* keep compiler happy */
        }
 }
 
@@ -163,40 +141,35 @@ ExecRenameStmt(RenameStmt *stmt)
  * Executes an ALTER OBJECT / SET SCHEMA statement.  Based on the object
  * type, the function appropriate to that type is executed.
  */
-void
+Oid
 ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt)
 {
        switch (stmt->objectType)
        {
                case OBJECT_AGGREGATE:
-                       AlterFunctionNamespace(stmt->object, stmt->objarg, true,
-                                                                  stmt->newschema);
-                       break;
+                       return AlterFunctionNamespace(stmt->object, stmt->objarg, true,
+                                                                                 stmt->newschema);
 
                case OBJECT_COLLATION:
-                       AlterCollationNamespace(stmt->object, stmt->newschema);
-                       break;
+                       return AlterCollationNamespace(stmt->object, stmt->newschema);
 
                case OBJECT_EXTENSION:
-                       AlterExtensionNamespace(stmt->object, stmt->newschema);
-                       break;
+                       return AlterExtensionNamespace(stmt->object, stmt->newschema);
 
                case OBJECT_FUNCTION:
-                       AlterFunctionNamespace(stmt->object, stmt->objarg, false,
-                                                                  stmt->newschema);
-                       break;
+                       return AlterFunctionNamespace(stmt->object, stmt->objarg, false,
+                                                                                 stmt->newschema);
 
                case OBJECT_SEQUENCE:
                case OBJECT_TABLE:
                case OBJECT_VIEW:
                case OBJECT_FOREIGN_TABLE:
-                       AlterTableNamespace(stmt);
-                       break;
+                       return AlterTableNamespace(stmt);
 
                case OBJECT_TYPE:
                case OBJECT_DOMAIN:
-                       AlterTypeNamespace(stmt->object, stmt->newschema, stmt->objectType);
-                       break;
+                       return AlterTypeNamespace(stmt->object, stmt->newschema,
+                                                                         stmt->objectType);
 
                        /* generic code path */
                case OBJECT_CONVERSION:
@@ -228,12 +201,15 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt)
                                AlterObjectNamespace_internal(catalog, address.objectId,
                                                                                          nspOid);
                                heap_close(catalog, RowExclusiveLock);
+
+                               return address.objectId;
                        }
                        break;
 
                default:
                        elog(ERROR, "unrecognized AlterObjectSchemaStmt type: %d",
                                 (int) stmt->objectType);
+                       return InvalidOid;      /* keep compiler happy */
        }
 }
 
@@ -435,7 +411,7 @@ AlterObjectNamespace_internal(Relation rel, Oid objid, Oid nspOid)
  * Executes an ALTER OBJECT / OWNER TO statement.  Based on the object
  * type, the function appropriate to that type is executed.
  */
-void
+Oid
 ExecAlterOwnerStmt(AlterOwnerStmt *stmt)
 {
        Oid                     newowner = get_role_oid(stmt->newowner, false);
@@ -443,30 +419,27 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt)
        switch (stmt->objectType)
        {
                case OBJECT_DATABASE:
-                       AlterDatabaseOwner(strVal(linitial(stmt->object)), newowner);
-                       break;
+                       return AlterDatabaseOwner(strVal(linitial(stmt->object)), newowner);
 
                case OBJECT_SCHEMA:
-                       AlterSchemaOwner(strVal(linitial(stmt->object)), newowner);
-                       break;
+                       return AlterSchemaOwner(strVal(linitial(stmt->object)), newowner);
 
                case OBJECT_TYPE:
                case OBJECT_DOMAIN:             /* same as TYPE */
-                       AlterTypeOwner(stmt->object, newowner, stmt->objectType);
+                       return AlterTypeOwner(stmt->object, newowner, stmt->objectType);
                        break;
 
                case OBJECT_FDW:
-                       AlterForeignDataWrapperOwner(strVal(linitial(stmt->object)),
-                                                                                newowner);
-                       break;
+                       return AlterForeignDataWrapperOwner(strVal(linitial(stmt->object)),
+                                                                                               newowner);
 
                case OBJECT_FOREIGN_SERVER:
-                       AlterForeignServerOwner(strVal(linitial(stmt->object)), newowner);
-                       break;
+                       return AlterForeignServerOwner(strVal(linitial(stmt->object)),
+                                                                                  newowner);
 
                case OBJECT_EVENT_TRIGGER:
-                       AlterEventTriggerOwner(strVal(linitial(stmt->object)), newowner);
-                       break;
+                       return AlterEventTriggerOwner(strVal(linitial(stmt->object)),
+                                                                                 newowner);
 
                /* Generic cases */
                case OBJECT_AGGREGATE:
@@ -508,12 +481,16 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt)
 
                                AlterObjectOwner_internal(catalog, address.objectId, newowner);
                                heap_close(catalog, RowExclusiveLock);
+
+                               return address.objectId;
                        }
                        break;
 
                default:
                        elog(ERROR, "unrecognized AlterOwnerStmt type: %d",
                                 (int) stmt->objectType);
+
+                       return InvalidOid;      /* keep compiler happy */
        }
 }
 
index ec22d11293e2c80f31470fb7ebdcc01b2fcb8a44..9fbb223f3fce6fc1180c30cf87ddc9b4691ae5c5 100644 (file)
@@ -37,7 +37,7 @@
 /*
  * CREATE COLLATION
  */
-void
+Oid
 DefineCollation(List *names, List *parameters)
 {
        char       *collName;
@@ -140,12 +140,14 @@ DefineCollation(List *names, List *parameters)
        /* check that the locales can be loaded */
        CommandCounterIncrement();
        (void) pg_newlocale_from_collation(newoid);
+
+       return newoid;
 }
 
 /*
  * Rename collation
  */
-void
+Oid
 RenameCollation(List *name, const char *newname)
 {
        Oid                     collationOid;
@@ -206,12 +208,14 @@ RenameCollation(List *name, const char *newname)
        heap_freetuple(tup);
 
        heap_close(rel, RowExclusiveLock);
+
+       return collationOid;
 }
 
 /*
  * Execute ALTER COLLATION SET SCHEMA
  */
-void
+Oid
 AlterCollationNamespace(List *name, const char *newschema)
 {
        Oid                     collOid,
@@ -222,6 +226,8 @@ AlterCollationNamespace(List *name, const char *newschema)
        nspOid = LookupCreationNamespace(newschema);
 
        AlterCollationNamespace_oid(collOid, nspOid);
+
+       return collOid;
 }
 
 /*
index 3a71e334cef92f37ebb1a9aae50758a0ebe27aef..3a287723975aeb03222c42b37f391bda130abef5 100644 (file)
@@ -34,7 +34,7 @@
 /*
  * CREATE CONVERSION
  */
-void
+Oid
 CreateConversionCommand(CreateConversionStmt *stmt)
 {
        Oid                     namespaceId;
@@ -111,14 +111,14 @@ CreateConversionCommand(CreateConversionStmt *stmt)
         * All seem ok, go ahead (possible failure would be a duplicate conversion
         * name)
         */
-       ConversionCreate(conversion_name, namespaceId, GetUserId(),
-                                        from_encoding, to_encoding, funcoid, stmt->def);
+       return ConversionCreate(conversion_name, namespaceId, GetUserId(),
+                                                       from_encoding, to_encoding, funcoid, stmt->def);
 }
 
 /*
  * Rename conversion
  */
-void
+Oid
 RenameConversion(List *name, const char *newname)
 {
        Oid                     conversionOid;
@@ -164,4 +164,6 @@ RenameConversion(List *name, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return conversionOid;
 }
index 3c13c470fdc312bb396538428befb7f3b1de3f02..c390575f422bd328a26d2d234652262df5604b2d 100644 (file)
@@ -900,7 +900,7 @@ dropdb(const char *dbname, bool missing_ok)
 /*
  * Rename database
  */
-void
+Oid
 RenameDatabase(const char *oldname, const char *newname)
 {
        Oid                     db_id;
@@ -977,6 +977,8 @@ RenameDatabase(const char *oldname, const char *newname)
         * Close pg_database, but keep lock till commit.
         */
        heap_close(rel, NoLock);
+
+       return db_id;
 }
 
 
@@ -1436,9 +1438,10 @@ AlterDatabaseSet(AlterDatabaseSetStmt *stmt)
 /*
  * ALTER DATABASE name OWNER TO newowner
  */
-void
+Oid
 AlterDatabaseOwner(const char *dbname, Oid newOwnerId)
 {
+       Oid                     db_id;
        HeapTuple       tuple;
        Relation        rel;
        ScanKeyData scankey;
@@ -1463,6 +1466,7 @@ AlterDatabaseOwner(const char *dbname, Oid newOwnerId)
                                (errcode(ERRCODE_UNDEFINED_DATABASE),
                                 errmsg("database \"%s\" does not exist", dbname)));
 
+       db_id = HeapTupleGetOid(tuple);
        datForm = (Form_pg_database) GETSTRUCT(tuple);
 
        /*
@@ -1539,6 +1543,8 @@ AlterDatabaseOwner(const char *dbname, Oid newOwnerId)
 
        /* Close pg_database, but keep lock till commit */
        heap_close(rel, NoLock);
+
+       return db_id;
 }
 
 
index 1edffee410e816d6c236306207de817f928cd32d..722c3cf118c0a0db9e5930d063cb2116a8c5f4d1 100644 (file)
@@ -413,9 +413,10 @@ AlterEventTrigger(AlterEventTrigStmt *stmt)
 /*
  * Rename event trigger
  */
-void
+Oid
 RenameEventTrigger(const char *trigname, const char *newname)
 {
+       Oid                     evtId;
        HeapTuple       tup;
        Relation        rel;
        Form_pg_event_trigger evtForm;
@@ -438,6 +439,8 @@ RenameEventTrigger(const char *trigname, const char *newname)
                aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_EVENT_TRIGGER,
                                           trigname);
 
+       evtId = HeapTupleGetOid(tup);
+
        evtForm = (Form_pg_event_trigger) GETSTRUCT(tup);
 
        /* tuple is a copy, so we can rename it now */
@@ -447,15 +450,18 @@ RenameEventTrigger(const char *trigname, const char *newname)
 
        heap_freetuple(tup);
        heap_close(rel, RowExclusiveLock);
+
+       return evtId;
 }
 
 
 /*
  * Change event trigger's owner -- by name
  */
-void
+Oid
 AlterEventTriggerOwner(const char *name, Oid newOwnerId)
 {
+       Oid                     evtOid;
        HeapTuple       tup;
        Relation        rel;
 
@@ -468,11 +474,15 @@ AlterEventTriggerOwner(const char *name, Oid newOwnerId)
                                (errcode(ERRCODE_UNDEFINED_OBJECT),
                                 errmsg("event trigger \"%s\" does not exist", name)));
 
+       evtOid = HeapTupleGetOid(tup);
+
        AlterEventTriggerOwner_internal(rel, tup, newOwnerId);
 
        heap_freetuple(tup);
 
        heap_close(rel, RowExclusiveLock);
+
+       return evtOid;
 }
 
 /*
index 3b8e22425cac43507a0c0f2e9a7bd900df709dfd..ad072a5c7b035f9a1ba5f4d70db94169cd710200 100644 (file)
@@ -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;
 }
 
 /*
index f10cb5252d927cae27c4d135adc760c11eb162b9..af833b886bf3a52d67a85214126270957dd860e6 100644 (file)
@@ -204,9 +204,10 @@ GetUserOidFromMapping(const char *username, bool missing_ok)
 /*
  * Rename foreign-data wrapper
  */
-void
+Oid
 RenameForeignDataWrapper(const char *oldname, const char *newname)
 {
+       Oid                     fdwId;
        HeapTuple       tup;
        Relation        rel;
 
@@ -218,6 +219,8 @@ RenameForeignDataWrapper(const char *oldname, const char *newname)
                                (errcode(ERRCODE_UNDEFINED_OBJECT),
                         errmsg("foreign-data wrapper \"%s\" does not exist", oldname)));
 
+       fdwId = HeapTupleGetOid(tup);
+
        /* make sure the new name doesn't exist */
        if (SearchSysCacheExists1(FOREIGNDATAWRAPPERNAME, CStringGetDatum(newname)))
                ereport(ERROR,
@@ -236,15 +239,18 @@ RenameForeignDataWrapper(const char *oldname, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return fdwId;
 }
 
 
 /*
  * Rename foreign server
  */
-void
+Oid
 RenameForeignServer(const char *oldname, const char *newname)
 {
+       Oid                     srvId;
        HeapTuple       tup;
        Relation        rel;
 
@@ -256,6 +262,8 @@ RenameForeignServer(const char *oldname, const char *newname)
                                (errcode(ERRCODE_UNDEFINED_OBJECT),
                                 errmsg("server \"%s\" does not exist", oldname)));
 
+       srvId = HeapTupleGetOid(tup);
+
        /* make sure the new name doesn't exist */
        if (SearchSysCacheExists1(FOREIGNSERVERNAME, CStringGetDatum(newname)))
                ereport(ERROR,
@@ -274,6 +282,8 @@ RenameForeignServer(const char *oldname, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return srvId;
 }
 
 
@@ -325,9 +335,10 @@ AlterForeignDataWrapperOwner_internal(Relation rel, HeapTuple tup, Oid newOwnerI
  *
  * Note restrictions in the "_internal" function, above.
  */
-void
+Oid
 AlterForeignDataWrapperOwner(const char *name, Oid newOwnerId)
 {
+       Oid                     fdwId;
        HeapTuple       tup;
        Relation        rel;
 
@@ -340,11 +351,15 @@ AlterForeignDataWrapperOwner(const char *name, Oid newOwnerId)
                                (errcode(ERRCODE_UNDEFINED_OBJECT),
                                 errmsg("foreign-data wrapper \"%s\" does not exist", name)));
 
+       fdwId = HeapTupleGetOid(tup);
+
        AlterForeignDataWrapperOwner_internal(rel, tup, newOwnerId);
 
        heap_freetuple(tup);
 
        heap_close(rel, RowExclusiveLock);
+
+       return fdwId;
 }
 
 /*
@@ -426,9 +441,10 @@ AlterForeignServerOwner_internal(Relation rel, HeapTuple tup, Oid newOwnerId)
 /*
  * Change foreign server owner -- by name
  */
-void
+Oid
 AlterForeignServerOwner(const char *name, Oid newOwnerId)
 {
+       Oid                     servOid;
        HeapTuple       tup;
        Relation        rel;
 
@@ -441,11 +457,15 @@ AlterForeignServerOwner(const char *name, Oid newOwnerId)
                                (errcode(ERRCODE_UNDEFINED_OBJECT),
                                 errmsg("server \"%s\" does not exist", name)));
 
+       servOid = HeapTupleGetOid(tup);
+
        AlterForeignServerOwner_internal(rel, tup, newOwnerId);
 
        heap_freetuple(tup);
 
        heap_close(rel, RowExclusiveLock);
+
+       return servOid;
 }
 
 /*
index 453e33ae66832c06c562bcc3ce73fbb17c02df30..2c36ce0e0f75764cf945a93654270e93415c38c5 100644 (file)
@@ -784,7 +784,7 @@ interpret_AS_clause(Oid languageOid, const char *languageName,
  * CreateFunction
  *      Execute a CREATE FUNCTION utility statement.
  */
-void
+Oid
 CreateFunction(CreateFunctionStmt *stmt, const char *queryString)
 {
        char       *probin_str;
@@ -960,30 +960,30 @@ CreateFunction(CreateFunctionStmt *stmt, const char *queryString)
         * And now that we have all the parameters, and know we're permitted to do
         * so, go ahead and create the function.
         */
-       ProcedureCreate(funcname,
-                                       namespaceId,
-                                       stmt->replace,
-                                       returnsSet,
-                                       prorettype,
-                                       GetUserId(),
-                                       languageOid,
-                                       languageValidator,
-                                       prosrc_str, /* converted to text later */
-                                       probin_str, /* converted to text later */
-                                       false,          /* not an aggregate */
-                                       isWindowFunc,
-                                       security,
-                                       isLeakProof,
-                                       isStrict,
-                                       volatility,
-                                       parameterTypes,
-                                       PointerGetDatum(allParameterTypes),
-                                       PointerGetDatum(parameterModes),
-                                       PointerGetDatum(parameterNames),
-                                       parameterDefaults,
-                                       PointerGetDatum(proconfig),
-                                       procost,
-                                       prorows);
+       return ProcedureCreate(funcname,
+                                                  namespaceId,
+                                                  stmt->replace,
+                                                  returnsSet,
+                                                  prorettype,
+                                                  GetUserId(),
+                                                  languageOid,
+                                                  languageValidator,
+                                                  prosrc_str, /* converted to text later */
+                                                  probin_str, /* converted to text later */
+                                                  false,               /* not an aggregate */
+                                                  isWindowFunc,
+                                                  security,
+                                                  isLeakProof,
+                                                  isStrict,
+                                                  volatility,
+                                                  parameterTypes,
+                                                  PointerGetDatum(allParameterTypes),
+                                                  PointerGetDatum(parameterModes),
+                                                  PointerGetDatum(parameterNames),
+                                                  parameterDefaults,
+                                                  PointerGetDatum(proconfig),
+                                                  procost,
+                                                  prorows);
 }
 
 
@@ -1040,7 +1040,7 @@ RemoveFunctionById(Oid funcOid)
 /*
  * Rename function
  */
-void
+Oid
 RenameFunction(List *name, List *argtypes, const char *newname)
 {
        Oid                     procOid;
@@ -1102,6 +1102,8 @@ RenameFunction(List *name, List *argtypes, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return procOid;
 }
 
 /*
@@ -1686,7 +1688,7 @@ DropCastById(Oid castOid)
  *
  * These commands are identical except for the lookup procedure, so share code.
  */
-void
+Oid
 AlterFunctionNamespace(List *name, List *argtypes, bool isagg,
                                           const char *newschema)
 {
@@ -1703,6 +1705,8 @@ AlterFunctionNamespace(List *name, List *argtypes, bool isagg,
        nspOid = LookupCreationNamespace(newschema);
 
        AlterFunctionNamespace_oid(procOid, nspOid);
+
+       return procOid;
 }
 
 Oid
index 099bb391396fd4872d1fd0be4cf2bd6fcf5fc49b..b85f1cb6407a31f7940ca2730874cc0591620576 100644 (file)
@@ -1660,7 +1660,7 @@ RemoveAmProcEntryById(Oid entryOid)
 /*
  * Rename opclass
  */
-void
+Oid
 RenameOpClass(List *name, const char *access_method, const char *newname)
 {
        Oid                     opcOid;
@@ -1713,12 +1713,14 @@ RenameOpClass(List *name, const char *access_method, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return opcOid;
 }
 
 /*
  * Rename opfamily
  */
-void
+Oid
 RenameOpFamily(List *name, const char *access_method, const char *newname)
 {
        Oid                     opfOid;
@@ -1802,6 +1804,8 @@ RenameOpFamily(List *name, const char *access_method, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return opfOid;
 }
 
 /*
index f31bf36e9b5f4e064393a40679300e5239ee8ce3..10666a9ef44bdc6ffc53c03bc5b581dd82a17801 100644 (file)
@@ -59,7 +59,7 @@
  *
  * 'parameters' is a list of DefElem
  */
-void
+Oid
 DefineOperator(List *names, List *parameters)
 {
        char       *oprName;
@@ -295,20 +295,20 @@ DefineOperator(List *names, List *parameters)
        /*
         * now have OperatorCreate do all the work..
         */
-       OperatorCreate(oprName,         /* operator name */
-                                  oprNamespace,        /* namespace */
-                                  typeId1,             /* left type id */
-                                  typeId2,             /* right type id */
-                                  functionOid, /* function for operator */
-                                  commutatorName,              /* optional commutator operator name */
-                                  negatorName, /* optional negator operator name */
-                                  restrictionOid,              /* optional restrict. sel. procedure */
-                                  joinOid,             /* optional join sel. procedure name */
-                                  canMerge,    /* operator merges */
-                                  canHash);    /* operator hashes */
+       return
+               OperatorCreate(oprName,         /* operator name */
+                                          oprNamespace,        /* namespace */
+                                          typeId1,             /* left type id */
+                                          typeId2,             /* right type id */
+                                          functionOid, /* function for operator */
+                                          commutatorName,              /* optional commutator operator name */
+                                          negatorName, /* optional negator operator name */
+                                          restrictionOid,              /* optional restrict. sel. procedure */
+                                          joinOid,             /* optional join sel. procedure name */
+                                          canMerge,    /* operator merges */
+                                          canHash);    /* operator hashes */
 }
 
-
 /*
  * Guts of operator deletion.
  */
index ee860c0e1a9d0e6da6413af7d92717c21b67ac75..93283b1a8418139be67651f8312368b15486d81d 100644 (file)
@@ -537,9 +537,10 @@ DropProceduralLanguageById(Oid langOid)
 /*
  * Rename language
  */
-void
+Oid
 RenameLanguage(const char *oldname, const char *newname)
 {
+       Oid                     lanId;
        HeapTuple       tup;
        Relation        rel;
 
@@ -551,6 +552,8 @@ RenameLanguage(const char *oldname, const char *newname)
                                (errcode(ERRCODE_UNDEFINED_OBJECT),
                                 errmsg("language \"%s\" does not exist", oldname)));
 
+       lanId = HeapTupleGetOid(tup);
+
        /* make sure the new name doesn't exist */
        if (SearchSysCacheExists1(LANGNAME, CStringGetDatum(newname)))
                ereport(ERROR,
@@ -569,6 +572,8 @@ RenameLanguage(const char *oldname, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return lanId;
 }
 
 /*
index e69c86bbabfe69a528643eec737eb85696697600..4aff37fffd23da02c10b75c45ba05ac515a77b03 100644 (file)
@@ -38,7 +38,7 @@ static void AlterSchemaOwner_internal(HeapTuple tup, Relation rel, Oid newOwnerI
 /*
  * CREATE SCHEMA
  */
-void
+Oid
 CreateSchemaCommand(CreateSchemaStmt *stmt, const char *queryString)
 {
        const char *schemaName = stmt->schemaname;
@@ -97,7 +97,7 @@ CreateSchemaCommand(CreateSchemaStmt *stmt, const char *queryString)
                                (errcode(ERRCODE_DUPLICATE_SCHEMA),
                                 errmsg("schema \"%s\" already exists, skipping",
                                                schemaName)));
-               return;
+               return InvalidOid;
        }
 
        /*
@@ -163,6 +163,8 @@ CreateSchemaCommand(CreateSchemaStmt *stmt, const char *queryString)
 
        /* Reset current user and security context */
        SetUserIdAndSecContext(saved_uid, save_sec_context);
+
+       return namespaceId;
 }
 
 /*
@@ -192,9 +194,10 @@ RemoveSchemaById(Oid schemaOid)
 /*
  * Rename schema
  */
-void
+Oid
 RenameSchema(const char *oldname, const char *newname)
 {
+       Oid                     nspOid;
        HeapTuple       tup;
        Relation        rel;
        AclResult       aclresult;
@@ -207,6 +210,8 @@ RenameSchema(const char *oldname, const char *newname)
                                (errcode(ERRCODE_UNDEFINED_SCHEMA),
                                 errmsg("schema \"%s\" does not exist", oldname)));
 
+       nspOid = HeapTupleGetOid(tup);
+
        /* make sure the new name doesn't exist */
        if (OidIsValid(get_namespace_oid(newname, true)))
                ereport(ERROR,
@@ -237,6 +242,8 @@ RenameSchema(const char *oldname, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return nspOid;
 }
 
 void
@@ -262,9 +269,10 @@ AlterSchemaOwner_oid(Oid oid, Oid newOwnerId)
 /*
  * Change schema owner
  */
-void
+Oid
 AlterSchemaOwner(const char *name, Oid newOwnerId)
 {
+       Oid                     nspOid;
        HeapTuple       tup;
        Relation        rel;
 
@@ -276,11 +284,15 @@ AlterSchemaOwner(const char *name, Oid newOwnerId)
                                (errcode(ERRCODE_UNDEFINED_SCHEMA),
                                 errmsg("schema \"%s\" does not exist", name)));
 
+       nspOid = HeapTupleGetOid(tup);
+
        AlterSchemaOwner_internal(tup, rel, newOwnerId);
 
        ReleaseSysCache(tup);
 
        heap_close(rel, RowExclusiveLock);
+
+       return nspOid;
 }
 
 static void
index 5583e721ead8f51d9b8627e1ee73200e2abd7eee..585b5b2bed6e44f3d880201390878945f67a0287 100644 (file)
@@ -103,7 +103,7 @@ static void process_owned_by(Relation seqrel, List *owned_by);
  * DefineSequence
  *                             Creates a new sequence relation
  */
-void
+Oid
 DefineSequence(CreateSeqStmt *seq)
 {
        FormData_pg_sequence new;
@@ -228,6 +228,8 @@ DefineSequence(CreateSeqStmt *seq)
                process_owned_by(rel, owned_by);
 
        heap_close(rel, NoLock);
+
+       return seqoid;
 }
 
 /*
@@ -400,7 +402,7 @@ fill_seq_with_data(Relation rel, HeapTuple tuple)
  *
  * Modify the definition of a sequence relation
  */
-void
+Oid
 AlterSequence(AlterSeqStmt *stmt)
 {
        Oid                     relid;
@@ -419,7 +421,7 @@ AlterSequence(AlterSeqStmt *stmt)
                ereport(NOTICE,
                                (errmsg("relation \"%s\" does not exist, skipping",
                                                stmt->sequence->relname)));
-               return;
+               return InvalidOid;
        }
 
        init_sequence(relid, &elm, &seqrel);
@@ -483,6 +485,8 @@ AlterSequence(AlterSeqStmt *stmt)
                process_owned_by(seqrel, owned_by);
 
        relation_close(seqrel, NoLock);
+
+       return relid;
 }
 
 
index 761374741db9f7c329f845e9952e4daed05f288d..adbaa2975e7b3174767026b2d60ac5dfdaa7a2c7 100644 (file)
@@ -2098,7 +2098,7 @@ renameatt_internal(Oid myrelid,
        Relation        targetrelation;
        Relation        attrelation;
        HeapTuple       atttup;
-       Form_pg_attribute attform;
+       Form_pg_attribute       attform;
        int                     attnum;
 
        /*
@@ -2248,7 +2248,7 @@ RangeVarCallbackForRenameAttribute(const RangeVar *rv, Oid relid, Oid oldrelid,
 /*
  *             renameatt               - changes the name of a attribute in a relation
  */
-void
+Oid
 renameatt(RenameStmt *stmt)
 {
        Oid                     relid;
@@ -2264,7 +2264,7 @@ renameatt(RenameStmt *stmt)
                ereport(NOTICE,
                                (errmsg("relation \"%s\" does not exist, skipping",
                                                stmt->relation->relname)));
-               return;
+               return InvalidOid;
        }
 
        renameatt_internal(relid,
@@ -2274,13 +2274,16 @@ renameatt(RenameStmt *stmt)
                                           false,       /* recursing? */
                                           0,           /* expected inhcount */
                                           stmt->behavior);
+
+       /* This is an ALTER TABLE command so it's about the relid */
+       return relid;
 }
 
 
 /*
  * same logic as renameatt_internal
  */
-static void
+static Oid
 rename_constraint_internal(Oid myrelid,
                                                   Oid mytypid,
                                                   const char *oldconname,
@@ -2372,9 +2375,11 @@ rename_constraint_internal(Oid myrelid,
 
        if (targetrelation)
                relation_close(targetrelation, NoLock); /* close rel but keep lock */
+
+       return constraintOid;
 }
 
-void
+Oid
 RenameConstraint(RenameStmt *stmt)
 {
        Oid                     relid = InvalidOid;
@@ -2403,18 +2408,20 @@ RenameConstraint(RenameStmt *stmt)
                                                                                 NULL);
        }
 
-       rename_constraint_internal(relid, typid,
-                                                          stmt->subname,
-                                                          stmt->newname,
-                stmt->relation ? interpretInhOption(stmt->relation->inhOpt) : false,   /* recursive? */
-                                                          false,       /* recursing? */
-                                                          0 /* expected inhcount */ );
+       return
+               rename_constraint_internal(relid, typid,
+                                                                  stmt->subname,
+                                                                  stmt->newname,
+                                                                  stmt->relation ? interpretInhOption(stmt->relation->inhOpt) : false, /* recursive? */
+                                                                  false,       /* recursing? */
+                                                                  0 /* expected inhcount */ );
+
 }
 
 /*
  * Execute ALTER TABLE/INDEX/SEQUENCE/VIEW/FOREIGN TABLE RENAME
  */
-void
+Oid
 RenameRelation(RenameStmt *stmt)
 {
        Oid                     relid;
@@ -2436,11 +2443,13 @@ RenameRelation(RenameStmt *stmt)
                ereport(NOTICE,
                                (errmsg("relation \"%s\" does not exist, skipping",
                                                stmt->relation->relname)));
-               return;
+               return InvalidOid;
        }
 
        /* Do the work */
        RenameRelationInternal(relid, stmt->newname);
+
+       return relid;
 }
 
 /*
@@ -9746,7 +9755,7 @@ ATExecGenericOptions(Relation rel, List *options)
 /*
  * Execute ALTER TABLE SET SCHEMA
  */
-void
+Oid
 AlterTableNamespace(AlterObjectSchemaStmt *stmt)
 {
        Relation        rel;
@@ -9766,7 +9775,7 @@ AlterTableNamespace(AlterObjectSchemaStmt *stmt)
                ereport(NOTICE,
                                (errmsg("relation \"%s\" does not exist, skipping",
                                                stmt->relation->relname)));
-               return;
+               return InvalidOid;
        }
 
        rel = relation_open(relid, NoLock);
@@ -9801,6 +9810,8 @@ AlterTableNamespace(AlterObjectSchemaStmt *stmt)
 
        /* close rel, but keep lock until commit */
        relation_close(rel, NoLock);
+
+       return relid;
 }
 
 /*
index 5081d8411ec833202c3013ec47bd19d8de2c6c67..2c19db31e0d302e25e6baf4f27ffabe240b95c0b 100644 (file)
@@ -818,9 +818,10 @@ directory_is_empty(const char *path)
 /*
  * Rename a tablespace
  */
-void
+Oid
 RenameTableSpace(const char *oldname, const char *newname)
 {
+       Oid                     tspId;
        Relation        rel;
        ScanKeyData entry[1];
        HeapScanDesc scan;
@@ -843,6 +844,7 @@ RenameTableSpace(const char *oldname, const char *newname)
                                 errmsg("tablespace \"%s\" does not exist",
                                                oldname)));
 
+       tspId = HeapTupleGetOid(tup);
        newtuple = heap_copytuple(tup);
        newform = (Form_pg_tablespace) GETSTRUCT(newtuple);
 
@@ -881,6 +883,8 @@ RenameTableSpace(const char *oldname, const char *newname)
        CatalogUpdateIndexes(rel, newtuple);
 
        heap_close(rel, NoLock);
+
+       return tspId;
 }
 
 /*
index 91ef779c65a88fcd53e389c2d798fc492da9ccbd..1f5932a477a65fb19a76ed0031998d4477899ff4 100644 (file)
@@ -1193,9 +1193,10 @@ RangeVarCallbackForRenameTrigger(const RangeVar *rv, Oid relid, Oid oldrelid,
  *             modify tgname in trigger tuple
  *             update row in catalog
  */
-void
+Oid
 renametrig(RenameStmt *stmt)
 {
+       Oid                     tgoid;
        Relation        targetrel;
        Relation        tgrel;
        HeapTuple       tuple;
@@ -1261,6 +1262,7 @@ renametrig(RenameStmt *stmt)
                                                                SnapshotNow, 2, key);
        if (HeapTupleIsValid(tuple = systable_getnext(tgscan)))
        {
+               tgoid = HeapTupleGetOid(tuple);
                /*
                 * Update pg_trigger tuple with new tgname.
                 */
@@ -1297,6 +1299,8 @@ renametrig(RenameStmt *stmt)
         * Close rel, but keep exclusive lock!
         */
        relation_close(targetrel, NoLock);
+
+       return tgoid;
 }
 
 
index e545e95a49e713c46f0896ffe2129b864201d0e9..b922c6ed476298a5803f8556c9cf6ac4e0eecb25 100644 (file)
@@ -167,7 +167,7 @@ makeParserDependencies(HeapTuple tuple)
 /*
  * CREATE TEXT SEARCH PARSER
  */
-void
+Oid
 DefineTSParser(List *names, List *parameters)
 {
        char       *prsname;
@@ -278,6 +278,8 @@ DefineTSParser(List *names, List *parameters)
        heap_freetuple(tup);
 
        heap_close(prsRel, RowExclusiveLock);
+
+       return prsOid;
 }
 
 /*
@@ -306,7 +308,7 @@ RemoveTSParserById(Oid prsId)
 /*
  * ALTER TEXT SEARCH PARSER RENAME
  */
-void
+Oid
 RenameTSParser(List *oldname, const char *newname)
 {
        HeapTuple       tup;
@@ -344,6 +346,8 @@ RenameTSParser(List *oldname, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return prsId;
 }
 
 /* ---------------------- TS Dictionary commands -----------------------*/
@@ -439,7 +443,7 @@ verify_dictoptions(Oid tmplId, List *dictoptions)
 /*
  * CREATE TEXT SEARCH DICTIONARY
  */
-void
+Oid
 DefineTSDictionary(List *names, List *parameters)
 {
        ListCell   *pl;
@@ -526,12 +530,14 @@ DefineTSDictionary(List *names, List *parameters)
        heap_freetuple(tup);
 
        heap_close(dictRel, RowExclusiveLock);
+
+       return dictOid;
 }
 
 /*
  * ALTER TEXT SEARCH DICTIONARY RENAME
  */
-void
+Oid
 RenameTSDictionary(List *oldname, const char *newname)
 {
        HeapTuple       tup;
@@ -577,6 +583,8 @@ RenameTSDictionary(List *oldname, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return dictId;
 }
 
 /*
@@ -803,7 +811,7 @@ makeTSTemplateDependencies(HeapTuple tuple)
 /*
  * CREATE TEXT SEARCH TEMPLATE
  */
-void
+Oid
 DefineTSTemplate(List *names, List *parameters)
 {
        ListCell   *pl;
@@ -813,7 +821,7 @@ DefineTSTemplate(List *names, List *parameters)
        bool            nulls[Natts_pg_ts_template];
        NameData        dname;
        int                     i;
-       Oid                     dictOid;
+       Oid                     tmplOid;
        Oid                     namespaceoid;
        char       *tmplname;
 
@@ -877,7 +885,7 @@ DefineTSTemplate(List *names, List *parameters)
 
        tup = heap_form_tuple(tmplRel->rd_att, values, nulls);
 
-       dictOid = simple_heap_insert(tmplRel, tup);
+       tmplOid = simple_heap_insert(tmplRel, tup);
 
        CatalogUpdateIndexes(tmplRel, tup);
 
@@ -885,17 +893,19 @@ DefineTSTemplate(List *names, List *parameters)
 
        /* Post creation hook for new text search template */
        InvokeObjectAccessHook(OAT_POST_CREATE,
-                                                  TSTemplateRelationId, dictOid, 0, NULL);
+                                                  TSTemplateRelationId, tmplOid, 0, NULL);
 
        heap_freetuple(tup);
 
        heap_close(tmplRel, RowExclusiveLock);
+
+       return tmplOid;
 }
 
 /*
  * ALTER TEXT SEARCH TEMPLATE RENAME
  */
-void
+Oid
 RenameTSTemplate(List *oldname, const char *newname)
 {
        HeapTuple       tup;
@@ -934,6 +944,8 @@ RenameTSTemplate(List *oldname, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return tmplId;
 }
 
 /*
@@ -1076,7 +1088,7 @@ makeConfigurationDependencies(HeapTuple tuple, bool removeOld,
 /*
  * CREATE TEXT SEARCH CONFIGURATION
  */
-void
+Oid
 DefineTSConfiguration(List *names, List *parameters)
 {
        Relation        cfgRel;
@@ -1230,12 +1242,14 @@ DefineTSConfiguration(List *names, List *parameters)
        if (mapRel)
                heap_close(mapRel, RowExclusiveLock);
        heap_close(cfgRel, RowExclusiveLock);
+
+       return cfgOid;
 }
 
 /*
  * ALTER TEXT SEARCH CONFIGURATION RENAME
  */
-void
+Oid
 RenameTSConfiguration(List *oldname, const char *newname)
 {
        HeapTuple       tup;
@@ -1280,6 +1294,8 @@ RenameTSConfiguration(List *oldname, const char *newname)
 
        heap_close(rel, NoLock);
        heap_freetuple(tup);
+
+       return cfgId;
 }
 
 /*
index 36de6d7e28b1bf8c01e6d5edec5a0d62ed1fad68..6f99f38f118b3695f3df36a279fe1736718acc86 100644 (file)
@@ -111,7 +111,7 @@ static char *domainAddConstraint(Oid domainOid, Oid domainNamespace,
  * DefineType
  *             Registers a new base type.
  */
-void
+Oid
 DefineType(List *names, List *parameters)
 {
        char       *typeName;
@@ -225,7 +225,7 @@ DefineType(List *names, List *parameters)
                 * creating the shell type was all we're supposed to do.
                 */
                if (parameters == NIL)
-                       return;
+                       return InvalidOid;
        }
        else
        {
@@ -593,39 +593,41 @@ DefineType(List *names, List *parameters)
        /* alignment must be 'i' or 'd' for arrays */
        alignment = (alignment == 'd') ? 'd' : 'i';
 
-       TypeCreate(array_oid,           /* force assignment of this type OID */
-                          array_type,          /* type name */
-                          typeNamespace,       /* namespace */
-                          InvalidOid,          /* relation oid (n/a here) */
-                          0,                           /* relation kind (ditto) */
-                          GetUserId(),         /* owner's ID */
-                          -1,                          /* internal size (always varlena) */
-                          TYPTYPE_BASE,        /* type-type (base type) */
-                          TYPCATEGORY_ARRAY,           /* type-category (array) */
-                          false,                       /* array types are never preferred */
-                          delimiter,           /* array element delimiter */
-                          F_ARRAY_IN,          /* input procedure */
-                          F_ARRAY_OUT,         /* output procedure */
-                          F_ARRAY_RECV,        /* receive procedure */
-                          F_ARRAY_SEND,        /* send procedure */
-                          typmodinOid,         /* typmodin procedure */
-                          typmodoutOid,        /* typmodout procedure */
-                          F_ARRAY_TYPANALYZE,          /* analyze procedure */
-                          typoid,                      /* element type ID */
-                          true,                        /* yes this is an array type */
-                          InvalidOid,          /* no further array type */
-                          InvalidOid,          /* base type ID */
-                          NULL,                        /* never a default type value */
-                          NULL,                        /* binary default isn't sent either */
-                          false,                       /* never passed by value */
-                          alignment,           /* see above */
-                          'x',                         /* ARRAY is always toastable */
-                          -1,                          /* typMod (Domains only) */
-                          0,                           /* Array dimensions of typbasetype */
-                          false,                       /* Type NOT NULL */
-                          collation);          /* type's collation */
+       typoid = TypeCreate(array_oid,          /* force assignment of this type OID */
+                                               array_type,             /* type name */
+                                               typeNamespace,  /* namespace */
+                                               InvalidOid,             /* relation oid (n/a here) */
+                                               0,                              /* relation kind (ditto) */
+                                               GetUserId(),            /* owner's ID */
+                                               -1,                             /* internal size (always varlena) */
+                                               TYPTYPE_BASE,   /* type-type (base type) */
+                                               TYPCATEGORY_ARRAY,              /* type-category (array) */
+                                               false,                  /* array types are never preferred */
+                                               delimiter,              /* array element delimiter */
+                                               F_ARRAY_IN,             /* input procedure */
+                                               F_ARRAY_OUT,            /* output procedure */
+                                               F_ARRAY_RECV,   /* receive procedure */
+                                               F_ARRAY_SEND,   /* send procedure */
+                                               typmodinOid,            /* typmodin procedure */
+                                               typmodoutOid,   /* typmodout procedure */
+                                               F_ARRAY_TYPANALYZE,             /* analyze procedure */
+                                               typoid,                 /* element type ID */
+                                               true,                   /* yes this is an array type */
+                                               InvalidOid,             /* no further array type */
+                                               InvalidOid,             /* base type ID */
+                                               NULL,                   /* never a default type value */
+                                               NULL,                   /* binary default isn't sent either */
+                                               false,                  /* never passed by value */
+                                               alignment,              /* see above */
+                                               'x',                            /* ARRAY is always toastable */
+                                               -1,                             /* typMod (Domains only) */
+                                               0,                              /* Array dimensions of typbasetype */
+                                               false,                  /* Type NOT NULL */
+                                               collation);             /* type's collation */
 
        pfree(array_type);
+
+       return typoid;
 }
 
 /*
@@ -671,7 +673,7 @@ RemoveTypeById(Oid typeOid)
  * DefineDomain
  *             Registers a new domain.
  */
-void
+Oid
 DefineDomain(CreateDomainStmt *stmt)
 {
        char       *domainName;
@@ -1042,6 +1044,8 @@ DefineDomain(CreateDomainStmt *stmt)
         * Now we can clean up.
         */
        ReleaseSysCache(typeTup);
+
+       return domainoid;
 }
 
 
@@ -3092,7 +3096,7 @@ GetDomainConstraints(Oid typeOid)
 /*
  * Execute ALTER TYPE RENAME
  */
-void
+Oid
 RenameType(RenameStmt *stmt)
 {
        List       *names = stmt->object;
@@ -3161,12 +3165,14 @@ RenameType(RenameStmt *stmt)
 
        /* Clean up */
        heap_close(rel, RowExclusiveLock);
+
+       return typeOid;
 }
 
 /*
  * Change the owner of a type.
  */
-void
+Oid
 AlterTypeOwner(List *names, Oid newOwnerId, ObjectType objecttype)
 {
        TypeName   *typename;
@@ -3283,6 +3289,8 @@ AlterTypeOwner(List *names, Oid newOwnerId, ObjectType objecttype)
 
        /* Clean up */
        heap_close(rel, RowExclusiveLock);
+
+       return typeOid;
 }
 
 /*
@@ -3335,7 +3343,7 @@ AlterTypeOwnerInternal(Oid typeOid, Oid newOwnerId,
 /*
  * Execute ALTER TYPE SET SCHEMA
  */
-void
+Oid
 AlterTypeNamespace(List *names, const char *newschema, ObjectType objecttype)
 {
        TypeName   *typename;
@@ -3360,6 +3368,8 @@ AlterTypeNamespace(List *names, const char *newschema, ObjectType objecttype)
        objsMoved = new_object_addresses();
        AlterTypeNamespace_oid(typeOid, nspOid, objsMoved);
        free_object_addresses(objsMoved);
+
+       return typeOid;
 }
 
 Oid
index f178167d629d85b478f598c439bd563050b9564c..569385cf2342342c8e0f11f9e2c7e1f7482484b6 100644 (file)
@@ -1036,7 +1036,7 @@ DropRole(DropRoleStmt *stmt)
 /*
  * Rename role
  */
-void
+Oid
 RenameRole(const char *oldname, const char *newname)
 {
        HeapTuple       oldtuple,
@@ -1142,6 +1142,8 @@ RenameRole(const char *oldname, const char *newname)
         * Close pg_authid, but keep lock till commit.
         */
        heap_close(rel, NoLock);
+
+       return roleid;
 }
 
 /*
index 3e7e39d8ecc9356d26d79a5a2f4b7ea81c9c1678..1d496679817b56af2b12fc2220169b66a1922a69 100644 (file)
@@ -420,7 +420,7 @@ UpdateRangeTableOfViewParse(Oid viewOid, Query *viewParse)
  * DefineView
  *             Execute a CREATE VIEW command.
  */
-void
+Oid
 DefineView(ViewStmt *stmt, const char *queryString)
 {
        Query      *viewParse;
@@ -540,4 +540,6 @@ DefineView(ViewStmt *stmt, const char *queryString)
         * Now create the rules associated with the view.
         */
        DefineViewRules(viewOid, viewParse, stmt->replace);
+
+       return viewOid;
 }
index abfec5cdb9d4ac1356bfc3eec5c82312e20810e1..637c0b6c27cfa465ea8ad4c1ffb80778be93df30 100644 (file)
@@ -1728,7 +1728,7 @@ DESCR("range intersection");
 /*
  * function prototypes
  */
-extern void OperatorCreate(const char *operatorName,
+extern Oid OperatorCreate(const char *operatorName,
                           Oid operatorNamespace,
                           Oid leftTypeId,
                           Oid rightTypeId,
index 4493985ad387cf7b3fca218cf7352a305680b667..036ebe07807aa84024812b51e8cef62f9183d634 100644 (file)
 #include "nodes/parsenodes.h"
 #include "utils/relcache.h"
 
-extern void ExecRenameStmt(RenameStmt *stmt);
+extern Oid ExecRenameStmt(RenameStmt *stmt);
 
-extern void ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt);
+extern Oid ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt);
 extern Oid     AlterObjectNamespace_oid(Oid classId, Oid objid, Oid nspOid,
                                                 ObjectAddresses *objsMoved);
 extern Oid     AlterObjectNamespace_internal(Relation rel, Oid objid, Oid nspOid);
 
-extern void ExecAlterOwnerStmt(AlterOwnerStmt *stmt);
+extern Oid ExecAlterOwnerStmt(AlterOwnerStmt *stmt);
 extern void AlterObjectOwner_internal(Relation catalog, Oid objectId,
                                                  Oid new_ownerId);
 
index 6d9db099c295aad4fbc7209029a20481ebc2e7ee..f3c6f62f17a0199fd13847878a45cd91a48ded9a 100644 (file)
@@ -17,9 +17,9 @@
 
 #include "nodes/parsenodes.h"
 
-extern void DefineCollation(List *names, List *parameters);
-extern void RenameCollation(List *name, const char *newname);
-extern void AlterCollationNamespace(List *name, const char *newschema);
+extern Oid DefineCollation(List *names, List *parameters);
+extern Oid RenameCollation(List *name, const char *newname);
+extern Oid AlterCollationNamespace(List *name, const char *newschema);
 extern Oid     AlterCollationNamespace_oid(Oid collOid, Oid newNspOid);
 
 #endif   /* COLLATIONCMDS_H */
index 2f9abad947056a6d5610a8b021ccd1963e9641bd..844fb41e107c60d29c576cae4b9cba37feeba306 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "nodes/parsenodes.h"
 
-extern void CreateConversionCommand(CreateConversionStmt *parsetree);
-extern void RenameConversion(List *name, const char *newname);
+extern Oid CreateConversionCommand(CreateConversionStmt *parsetree);
+extern Oid RenameConversion(List *name, const char *newname);
 
 #endif   /* CONVERSIONCMDS_H */
index 41ca8ff1993c7a33d4998b463244a6285ea8ae1e..a48cf5f7b9fd40f36911c424dde4181db1c4219c 100644 (file)
@@ -54,10 +54,10 @@ typedef struct xl_dbase_drop_rec
 
 extern void createdb(const CreatedbStmt *stmt);
 extern void dropdb(const char *dbname, bool missing_ok);
-extern void RenameDatabase(const char *oldname, const char *newname);
+extern Oid RenameDatabase(const char *oldname, const char *newname);
 extern void AlterDatabase(AlterDatabaseStmt *stmt, bool isTopLevel);
 extern void AlterDatabaseSet(AlterDatabaseSetStmt *stmt);
-extern void AlterDatabaseOwner(const char *dbname, Oid newOwnerId);
+extern Oid AlterDatabaseOwner(const char *dbname, Oid newOwnerId);
 
 extern Oid     get_database_oid(const char *dbname, bool missingok);
 extern char *get_database_name(Oid dbid);
index 2c81b7899718e063669f240303c518402933b4fa..263f48cc971b03de13a5b8a1de18c6cfe3420bbd 100644 (file)
@@ -42,28 +42,28 @@ extern bool CheckIndexCompatible(Oid oldId,
 extern Oid     GetDefaultOpClass(Oid type_id, Oid am_id);
 
 /* commands/functioncmds.c */
-extern void CreateFunction(CreateFunctionStmt *stmt, const char *queryString);
+extern Oid CreateFunction(CreateFunctionStmt *stmt, const char *queryString);
 extern void RemoveFunctionById(Oid funcOid);
 extern void SetFunctionReturnType(Oid funcOid, Oid newRetType);
 extern void SetFunctionArgType(Oid funcOid, int argIndex, Oid newArgType);
-extern void RenameFunction(List *name, List *argtypes, const char *newname);
+extern Oid RenameFunction(List *name, List *argtypes, const char *newname);
 extern void AlterFunction(AlterFunctionStmt *stmt);
 extern void CreateCast(CreateCastStmt *stmt);
 extern void DropCastById(Oid castOid);
-extern void AlterFunctionNamespace(List *name, List *argtypes, bool isagg,
-                                          const char *newschema);
+extern Oid AlterFunctionNamespace(List *name, List *argtypes, bool isagg,
+                                                                 const char *newschema);
 extern Oid     AlterFunctionNamespace_oid(Oid procOid, Oid nspOid);
 extern void ExecuteDoStmt(DoStmt *stmt);
 extern Oid     get_cast_oid(Oid sourcetypeid, Oid targettypeid, bool missing_ok);
 
 /* commands/operatorcmds.c */
-extern void DefineOperator(List *names, List *parameters);
+extern Oid DefineOperator(List *names, List *parameters);
 extern void RemoveOperatorById(Oid operOid);
 
 /* commands/aggregatecmds.c */
-extern void DefineAggregate(List *name, List *args, bool oldstyle,
+extern Oid DefineAggregate(List *name, List *args, bool oldstyle,
                                List *parameters);
-extern void RenameAggregate(List *name, List *args, const char *newname);
+extern Oid RenameAggregate(List *name, List *args, const char *newname);
 
 /* commands/opclasscmds.c */
 extern void DefineOpClass(CreateOpClassStmt *stmt);
@@ -73,28 +73,28 @@ extern void RemoveOpClassById(Oid opclassOid);
 extern void RemoveOpFamilyById(Oid opfamilyOid);
 extern void RemoveAmOpEntryById(Oid entryOid);
 extern void RemoveAmProcEntryById(Oid entryOid);
-extern void RenameOpClass(List *name, const char *access_method, const char *newname);
-extern void RenameOpFamily(List *name, const char *access_method, const char *newname);
+extern Oid RenameOpClass(List *name, const char *access_method, const char *newname);
+extern Oid RenameOpFamily(List *name, const char *access_method, const char *newname);
 extern Oid     get_am_oid(const char *amname, bool missing_ok);
 extern Oid     get_opclass_oid(Oid amID, List *opclassname, bool missing_ok);
 extern Oid     get_opfamily_oid(Oid amID, List *opfamilyname, bool missing_ok);
 
 /* commands/tsearchcmds.c */
-extern void DefineTSParser(List *names, List *parameters);
-extern void RenameTSParser(List *oldname, const char *newname);
+extern Oid DefineTSParser(List *names, List *parameters);
+extern Oid RenameTSParser(List *oldname, const char *newname);
 extern void RemoveTSParserById(Oid prsId);
 
-extern void DefineTSDictionary(List *names, List *parameters);
-extern void RenameTSDictionary(List *oldname, const char *newname);
+extern Oid DefineTSDictionary(List *names, List *parameters);
+extern Oid RenameTSDictionary(List *oldname, const char *newname);
 extern void RemoveTSDictionaryById(Oid dictId);
 extern void AlterTSDictionary(AlterTSDictionaryStmt *stmt);
 
-extern void DefineTSTemplate(List *names, List *parameters);
-extern void RenameTSTemplate(List *oldname, const char *newname);
+extern Oid DefineTSTemplate(List *names, List *parameters);
+extern Oid RenameTSTemplate(List *oldname, const char *newname);
 extern void RemoveTSTemplateById(Oid tmplId);
 
-extern void DefineTSConfiguration(List *names, List *parameters);
-extern void RenameTSConfiguration(List *oldname, const char *newname);
+extern Oid DefineTSConfiguration(List *names, List *parameters);
+extern Oid RenameTSConfiguration(List *oldname, const char *newname);
 extern void RemoveTSConfigurationById(Oid cfgId);
 extern void AlterTSConfiguration(AlterTSConfigurationStmt *stmt);
 
@@ -102,11 +102,11 @@ extern text *serialize_deflist(List *deflist);
 extern List *deserialize_deflist(Datum txt);
 
 /* commands/foreigncmds.c */
-extern void RenameForeignServer(const char *oldname, const char *newname);
-extern void RenameForeignDataWrapper(const char *oldname, const char *newname);
-extern void AlterForeignServerOwner(const char *name, Oid newOwnerId);
+extern Oid RenameForeignServer(const char *oldname, const char *newname);
+extern Oid RenameForeignDataWrapper(const char *oldname, const char *newname);
+extern Oid AlterForeignServerOwner(const char *name, Oid newOwnerId);
 extern void AlterForeignServerOwner_oid(Oid, Oid newOwnerId);
-extern void AlterForeignDataWrapperOwner(const char *name, Oid newOwnerId);
+extern Oid AlterForeignDataWrapperOwner(const char *name, Oid newOwnerId);
 extern void AlterForeignDataWrapperOwner_oid(Oid fwdId, Oid newOwnerId);
 extern void CreateForeignDataWrapper(CreateFdwStmt *stmt);
 extern void AlterForeignDataWrapper(AlterFdwStmt *stmt);
index f0847ff3fbecbb0c937939606c803cf5d228f921..205807512e26002e9c13ac98cdccc3e1a1c69607 100644 (file)
@@ -27,7 +27,7 @@ extern bool creating_extension;
 extern Oid     CurrentExtensionObject;
 
 
-extern void CreateExtension(CreateExtensionStmt *stmt);
+extern Oid CreateExtension(CreateExtensionStmt *stmt);
 
 extern void RemoveExtensionById(Oid extId);
 
@@ -43,7 +43,7 @@ extern void ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt);
 extern Oid     get_extension_oid(const char *extname, bool missing_ok);
 extern char *get_extension_name(Oid ext_oid);
 
-extern void AlterExtensionNamespace(List *names, const char *newschema);
+extern Oid AlterExtensionNamespace(List *names, const char *newschema);
 
 extern void AlterExtensionOwner_oid(Oid extensionOid, Oid newOwnerId);
 
index faf1f1c9f8c3fb2bcca9b2a2c870c2b8d0d88bdb..bc380792e578ed03d55b5723c7fd48599eedfef6 100644 (file)
@@ -16,7 +16,7 @@
 
 extern void CreateProceduralLanguage(CreatePLangStmt *stmt);
 extern void DropProceduralLanguageById(Oid langOid);
-extern void RenameLanguage(const char *oldname, const char *newname);
+extern Oid RenameLanguage(const char *oldname, const char *newname);
 extern bool PLTemplateExists(const char *languageName);
 extern Oid     get_language_oid(const char *langname, bool missing_ok);
 
index ea709c3d920b3ddcb2d16b77e21c477d9fefd047..1529eb1b856ca0bd3440d14d5d72d6a136b131b1 100644 (file)
 
 #include "nodes/parsenodes.h"
 
-extern void CreateSchemaCommand(CreateSchemaStmt *parsetree,
+extern Oid CreateSchemaCommand(CreateSchemaStmt *parsetree,
                                        const char *queryString);
 
 extern void RemoveSchemaById(Oid schemaOid);
 
-extern void RenameSchema(const char *oldname, const char *newname);
-extern void AlterSchemaOwner(const char *name, Oid newOwnerId);
+extern Oid RenameSchema(const char *oldname, const char *newname);
+extern Oid AlterSchemaOwner(const char *name, Oid newOwnerId);
 extern void AlterSchemaOwner_oid(Oid schemaOid, Oid newOwnerId);
 
 #endif   /* SCHEMACMDS_H */
index 2cdf86f101af3f5886ee51a4a73243c141424cd4..56bfaadf7f4b8a2df7b1324ae60cc50f49c602b6 100644 (file)
@@ -71,8 +71,8 @@ extern Datum lastval(PG_FUNCTION_ARGS);
 
 extern Datum pg_sequence_parameters(PG_FUNCTION_ARGS);
 
-extern void DefineSequence(CreateSeqStmt *stmt);
-extern void AlterSequence(AlterSeqStmt *stmt);
+extern Oid DefineSequence(CreateSeqStmt *stmt);
+extern Oid AlterSequence(AlterSeqStmt *stmt);
 extern void ResetSequence(Oid seq_relid);
 
 extern void seq_redo(XLogRecPtr lsn, XLogRecord *rptr);
index 4f32062056fba39c25c89d287fc831e927918db6..d0ef4ae170c9bbc7b9552131cf995437061e977c 100644 (file)
@@ -51,11 +51,11 @@ extern void ExecuteTruncate(TruncateStmt *stmt);
 
 extern void SetRelationHasSubclass(Oid relationId, bool relhassubclass);
 
-extern void renameatt(RenameStmt *stmt);
+extern Oid renameatt(RenameStmt *stmt);
 
-extern void RenameConstraint(RenameStmt *stmt);
+extern Oid RenameConstraint(RenameStmt *stmt);
 
-extern void RenameRelation(RenameStmt *stmt);
+extern Oid RenameRelation(RenameStmt *stmt);
 
 extern void RenameRelationInternal(Oid myrelid,
                                           const char *newrelname);
index be45c875c90393d449bb564ed11a2fb484a29ab1..4d5cb89101ffcb77c6816e77aacdd9cf250e701d 100644 (file)
@@ -41,7 +41,7 @@ typedef struct TableSpaceOpts
 
 extern void CreateTableSpace(CreateTableSpaceStmt *stmt);
 extern void DropTableSpace(DropTableSpaceStmt *stmt);
-extern void RenameTableSpace(const char *oldname, const char *newname);
+extern Oid RenameTableSpace(const char *oldname, const char *newname);
 extern void AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt);
 
 extern void TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo);
index e790b9d3009bf9e3eb11f8cc8643b8860669150c..a678750589c635fa1410e27cae6c2a7980c80081 100644 (file)
@@ -115,7 +115,7 @@ extern Oid CreateTrigger(CreateTrigStmt *stmt, const char *queryString,
 extern void RemoveTriggerById(Oid trigOid);
 extern Oid     get_trigger_oid(Oid relid, const char *name, bool missing_ok);
 
-extern void renametrig(RenameStmt *stmt);
+extern Oid renametrig(RenameStmt *stmt);
 
 extern void EnableDisableTrigger(Relation rel, const char *tgname,
                                         char fires_when, bool skip_system);
index e87ca900892555011e3f171cc985414c466bec83..48ee0163bdaf81d285bfb2f9524a29a85e7fc258 100644 (file)
@@ -21,9 +21,9 @@
 
 #define DEFAULT_TYPDELIM               ','
 
-extern void DefineType(List *names, List *parameters);
+extern Oid DefineType(List *names, List *parameters);
 extern void RemoveTypeById(Oid typeOid);
-extern void DefineDomain(CreateDomainStmt *stmt);
+extern Oid DefineDomain(CreateDomainStmt *stmt);
 extern void DefineEnum(CreateEnumStmt *stmt);
 extern void DefineRange(CreateRangeStmt *stmt);
 extern void AlterEnum(AlterEnumStmt *stmt, bool isTopLevel);
@@ -41,11 +41,11 @@ extern void checkDomainOwner(HeapTuple tup);
 
 extern List *GetDomainConstraints(Oid typeOid);
 
-extern void RenameType(RenameStmt *stmt);
-extern void AlterTypeOwner(List *names, Oid newOwnerId, ObjectType objecttype);
+extern Oid RenameType(RenameStmt *stmt);
+extern Oid AlterTypeOwner(List *names, Oid newOwnerId, ObjectType objecttype);
 extern void AlterTypeOwnerInternal(Oid typeOid, Oid newOwnerId,
                                           bool hasDependEntry);
-extern void AlterTypeNamespace(List *names, const char *newschema, ObjectType objecttype);
+extern Oid AlterTypeNamespace(List *names, const char *newschema, ObjectType objecttype);
 extern Oid     AlterTypeNamespace_oid(Oid typeOid, Oid nspOid, ObjectAddresses *objsMoved);
 extern Oid     AlterTypeNamespaceInternal(Oid typeOid, Oid nspOid,
                                                   bool isImplicitArray,
index 476654abf644457b847603724afa27614f2930aa..650fcea557486f530ad90efe0a6931527189cbd9 100644 (file)
@@ -27,7 +27,7 @@ extern void AlterRole(AlterRoleStmt *stmt);
 extern void AlterRoleSet(AlterRoleSetStmt *stmt);
 extern void DropRole(DropRoleStmt *stmt);
 extern void GrantRole(GrantRoleStmt *stmt);
-extern void RenameRole(const char *oldname, const char *newname);
+extern Oid RenameRole(const char *oldname, const char *newname);
 extern void DropOwnedObjects(DropOwnedStmt *stmt);
 extern void ReassignOwnedObjects(ReassignOwnedStmt *stmt);
 
index efebf95b7aa65a73c65c6de34dfa9b9ff4bbe493..f0b6b82223103928826f0907492fcd2416f2e381 100644 (file)
@@ -16,6 +16,6 @@
 
 #include "nodes/parsenodes.h"
 
-extern void DefineView(ViewStmt *stmt, const char *queryString);
+extern Oid DefineView(ViewStmt *stmt, const char *queryString);
 
 #endif   /* VIEW_H */