pgsql: Sort dependent objects before reporting them in DROP ROLE. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Sort dependent objects before reporting them in DROP ROLE.
Date
Msg-id E1h8BRS-0005bj-RV@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Sort dependent objects before reporting them in DROP ROLE.

Commit 8aa9dd74b didn't quite finish the job in this area after all,
because DROP ROLE has a code path distinct from DROP OWNED BY, and
it was still reporting dependent objects in whatever order the index
scan returned them in.

Buildfarm experience shows that index ordering of equal-keyed objects is
significantly less stable than before in the wake of using heap TIDs as
tie-breakers.  So if we try to hide the unstable ordering by suppressing
DETAIL reports, we're just going to end up having to do that for every
DROP that reports multiple objects.  That's not great from a coverage
or problem-detection standpoint, and it's something we'll inevitably
forget in future patches, leading to more iterations of fixing-an-
unstable-result.  So let's just bite the bullet and sort here too.

Discussion: https://postgr.es/m/E1h6eep-0001Mw-Vd@gemulon.postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/af6550d34466b3093edda54a0cc5a6f220d321b7

Modified Files
--------------
src/backend/catalog/pg_shdepend.c        | 132 +++++++++++++++++++++++++------
src/test/regress/expected/dependency.out |   4 +-
2 files changed, 111 insertions(+), 25 deletions(-)


pgsql-committers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: pgsql: Make heap TID a tiebreaker nbtree index column.
Next
From: Tom Lane
Date:
Subject: pgsql: Un-hide most cascaded-drop details in regression test results.