MCPcopy Create free account
hub / github.com/apache/cloudberry / StoreCatalogInheritance1

Function StoreCatalogInheritance1

src/backend/commands/tablecmds.c:3813–3850  ·  view source on GitHub ↗

* Make catalog entries showing relationId as being an inheritance child * of parentOid. inhRelation is the already-opened pg_inherits catalog. */

Source from the content-addressed store, hash-verified

3811 * of parentOid. inhRelation is the already-opened pg_inherits catalog.
3812 */
3813static void
3814StoreCatalogInheritance1(Oid relationId, Oid parentOid,
3815 int32 seqNumber, Relation inhRelation,
3816 bool child_is_partition)
3817{
3818 ObjectAddress childobject,
3819 parentobject;
3820
3821 /* store the pg_inherits row */
3822 StoreSingleInheritance(relationId, parentOid, seqNumber);
3823
3824 /*
3825 * Store a dependency too
3826 */
3827 parentobject.classId = RelationRelationId;
3828 parentobject.objectId = parentOid;
3829 parentobject.objectSubId = 0;
3830 childobject.classId = RelationRelationId;
3831 childobject.objectId = relationId;
3832 childobject.objectSubId = 0;
3833
3834 recordDependencyOn(&childobject, &parentobject,
3835 child_dependency_type(child_is_partition));
3836
3837 /*
3838 * Post creation hook of this inheritance. Since object_access_hook
3839 * doesn't take multiple object identifiers, we relay oid of parent
3840 * relation using auxiliary_id argument.
3841 */
3842 InvokeObjectPostAlterHookArg(InheritsRelationId,
3843 relationId, 0,
3844 parentOid, false);
3845
3846 /*
3847 * Mark the parent as having subclasses.
3848 */
3849 SetRelationHasSubclass(parentOid, true);
3850}
3851
3852/*
3853 * Look for an existing schema entry with the given name.

Callers 2

StoreCatalogInheritanceFunction · 0.85
CreateInheritanceFunction · 0.85

Calls 3

StoreSingleInheritanceFunction · 0.85
recordDependencyOnFunction · 0.85
SetRelationHasSubclassFunction · 0.85

Tested by

no test coverage detected