]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix pg_dump sorting of foreign key constraints
authorÁlvaro Herrera <alvherre@kurilemu.de>
Sat, 18 Oct 2025 15:50:10 +0000 (17:50 +0200)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Sat, 18 Oct 2025 15:50:10 +0000 (17:50 +0200)
Apparently, commit 04bc2c42f765 failed to notice that DO_FK_CONSTRAINT
objects require identical handling as DO_CONSTRAINT ones, which causes
some pg_upgrade tests in debug builds to fail spuriously.  Add that.

Author: Álvaro Herrera <alvherre@kurilemu.de>
Backpatch-through: 13
Discussion: https://postgr.es/m/202510181201.k6y75v2tpf5r@alvherre.pgsql

src/bin/pg_dump/pg_dump_sort.c

index a51064f21e3158366ebe57e55be6e8639e95a863..0aec83bedb23e0454f74bd79eee24668c19eb66b 100644 (file)
@@ -328,7 +328,8 @@ DOTypeNameCompare(const void *p1, const void *p2)
                if (cmpval != 0)
                        return cmpval;
        }
-       else if (obj1->objType == DO_CONSTRAINT)
+       else if (obj1->objType == DO_CONSTRAINT ||
+                        obj1->objType == DO_FK_CONSTRAINT)
        {
                ConstraintInfo *robj1 = *(ConstraintInfo *const *) p1;
                ConstraintInfo *robj2 = *(ConstraintInfo *const *) p2;