* namespace is. Also make a dependency link to its owner.
*
* For composite types, these dependencies are tracked for the pg_type
- * entry, so we needn't record them here. Also, skip this in bootstrap
- * mode, since we don't make dependencies while bootstrapping.
+ * entry, so we needn't record them here. Likewise, TOAST tables don't
+ * need a namespace dependency (they live in a pinned namespace) nor an
+ * owner dependency (they depend indirectly through the parent table).
+ * Also, skip this in bootstrap mode, since we don't make dependencies
+ * while bootstrapping.
*/
if (relkind != RELKIND_COMPOSITE_TYPE &&
+ relkind != RELKIND_TOASTVALUE &&
!IsBootstrapProcessingMode())
{
ObjectAddress myself,
/*
* Update owner dependency reference, if any. A composite type has
* none, because it's tracked for the pg_type entry instead of here;
- * indexes don't have their own entries either.
+ * indexes and TOAST tables don't have their own entries either.
*/
if (tuple_class->relkind != RELKIND_COMPOSITE_TYPE &&
- tuple_class->relkind != RELKIND_INDEX)
+ tuple_class->relkind != RELKIND_INDEX &&
+ tuple_class->relkind != RELKIND_TOASTVALUE)
changeDependencyOnOwner(RelationRelationId, relationOid,
newOwnerId);