mirror of https://github.com/citusdata/citus.git
Create wrapper function CreateObjectAddressDependencyDefList (#5623)
parent
4dca662e97
commit
8936543b80
|
@ -123,6 +123,7 @@ typedef struct ViewDependencyNode
|
|||
static List * GetRelationTriggerFunctionDepencyList(Oid relationId);
|
||||
static List * GetRelationStatsSchemaDependencyList(Oid relationId);
|
||||
static DependencyDefinition * CreateObjectAddressDependencyDef(Oid classId, Oid objectId);
|
||||
static List * CreateObjectAddressDependencyDefList(Oid classId, List *objectIdList);
|
||||
static ObjectAddress DependencyDefinitionObjectAddress(DependencyDefinition *definition);
|
||||
|
||||
/* forward declarations for functions to interact with the ObjectAddressCollector */
|
||||
|
@ -1003,18 +1004,9 @@ ExpandCitusSupportedTypes(ObjectAddressCollector *collector, ObjectAddress targe
|
|||
static List *
|
||||
GetRelationStatsSchemaDependencyList(Oid relationId)
|
||||
{
|
||||
List *dependencyList = NIL;
|
||||
|
||||
List *schemaIds = GetExplicitStatisticsSchemaIdList(relationId);
|
||||
Oid schemaId = InvalidOid;
|
||||
foreach_oid(schemaId, schemaIds)
|
||||
{
|
||||
DependencyDefinition *dependency =
|
||||
CreateObjectAddressDependencyDef(NamespaceRelationId, schemaId);
|
||||
dependencyList = lappend(dependencyList, dependency);
|
||||
}
|
||||
|
||||
return dependencyList;
|
||||
return CreateObjectAddressDependencyDefList(NamespaceRelationId, schemaIds);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1056,6 +1048,27 @@ CreateObjectAddressDependencyDef(Oid classId, Oid objectId)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* CreateObjectAddressDependencyDefList is a wrapper function for
|
||||
* CreateObjectAddressDependencyDef to operate on a list of relation oids,
|
||||
* instead of a single oid.
|
||||
*/
|
||||
static List *
|
||||
CreateObjectAddressDependencyDefList(Oid classId, List *objectIdList)
|
||||
{
|
||||
List *dependencyList = NIL;
|
||||
Oid objectId = InvalidOid;
|
||||
foreach_oid(objectId, objectIdList)
|
||||
{
|
||||
DependencyDefinition *dependency =
|
||||
CreateObjectAddressDependencyDef(classId, objectId);
|
||||
dependencyList = lappend(dependencyList, dependency);
|
||||
}
|
||||
|
||||
return dependencyList;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* DependencyDefinitionObjectAddress returns the object address of the dependency defined
|
||||
* by the dependency definition, irregardless what the source of the definition is
|
||||
|
|
Loading…
Reference in New Issue