* Make catalog entries showing relationId as being an inheritance child * of parentOid. inhRelation is the already-opened pg_inherits catalog. */
| 3811 | * of parentOid. inhRelation is the already-opened pg_inherits catalog. |
| 3812 | */ |
| 3813 | static void |
| 3814 | StoreCatalogInheritance1(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. |
no test coverage detected