diff options
Diffstat (limited to 'src/backend/catalog/pg_constraint.c')
-rw-r--r-- | src/backend/catalog/pg_constraint.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/catalog/pg_constraint.c b/src/backend/catalog/pg_constraint.c index 69979942af4..71c48ffa923 100644 --- a/src/backend/catalog/pg_constraint.c +++ b/src/backend/catalog/pg_constraint.c @@ -675,7 +675,7 @@ RenameConstraintById(Oid conId, const char *newname) */ void AlterConstraintNamespaces(Oid ownerId, Oid oldNspId, - Oid newNspId, bool isType) + Oid newNspId, bool isType, ObjectAddresses *objsMoved) { Relation conRel; ScanKeyData key[1]; @@ -708,6 +708,14 @@ AlterConstraintNamespaces(Oid ownerId, Oid oldNspId, while (HeapTupleIsValid((tup = systable_getnext(scan)))) { Form_pg_constraint conform = (Form_pg_constraint) GETSTRUCT(tup); + ObjectAddress thisobj; + + thisobj.classId = ConstraintRelationId; + thisobj.objectId = HeapTupleGetOid(tup); + thisobj.objectSubId = 0; + + if (object_address_present(&thisobj, objsMoved)) + continue; if (conform->connamespace == oldNspId) { @@ -725,6 +733,8 @@ AlterConstraintNamespaces(Oid ownerId, Oid oldNspId, * changeDependencyFor(). */ } + + add_exact_object_address(&thisobj, objsMoved); } systable_endscan(scan); |