aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/extension.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/extension.c')
-rw-r--r--src/backend/commands/extension.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c
index 472e69fdaf9..3b69ab7ed5c 100644
--- a/src/backend/commands/extension.c
+++ b/src/backend/commands/extension.c
@@ -1783,6 +1783,7 @@ InsertExtensionTuple(const char *extName, Oid extOwner,
HeapTuple tuple;
ObjectAddress myself;
ObjectAddress nsp;
+ ObjectAddresses *refobjs;
ListCell *lc;
/*
@@ -1825,27 +1826,26 @@ InsertExtensionTuple(const char *extName, Oid extOwner,
*/
recordDependencyOnOwner(ExtensionRelationId, extensionOid, extOwner);
- myself.classId = ExtensionRelationId;
- myself.objectId = extensionOid;
- myself.objectSubId = 0;
+ refobjs = new_object_addresses();
- nsp.classId = NamespaceRelationId;
- nsp.objectId = schemaOid;
- nsp.objectSubId = 0;
+ ObjectAddressSet(myself, ExtensionRelationId, extensionOid);
- recordDependencyOn(&myself, &nsp, DEPENDENCY_NORMAL);
+ ObjectAddressSet(nsp, NamespaceRelationId, schemaOid);
+ add_exact_object_address(&nsp, refobjs);
foreach(lc, requiredExtensions)
{
Oid reqext = lfirst_oid(lc);
ObjectAddress otherext;
- otherext.classId = ExtensionRelationId;
- otherext.objectId = reqext;
- otherext.objectSubId = 0;
-
- recordDependencyOn(&myself, &otherext, DEPENDENCY_NORMAL);
+ ObjectAddressSet(otherext, ExtensionRelationId, reqext);
+ add_exact_object_address(&otherext, refobjs);
}
+
+ /* Record all of them (this includes duplicate elimination) */
+ record_object_address_dependencies(&myself, refobjs, DEPENDENCY_NORMAL);
+ free_object_addresses(refobjs);
+
/* Post creation hook for new extension */
InvokeObjectPostCreateHook(ExtensionRelationId, extensionOid, 0);