Re: Test instability when pg_dump orders by OID - Mailing list pgsql-hackers

From Kirill Reshke
Subject Re: Test instability when pg_dump orders by OID
Date
Msg-id CALdSSPhZyLua3Vz2Ug8VOASbhP41h-7784MT8s9_+90eE06Aaw@mail.gmail.com
Whole thread Raw
In response to Re: Test instability when pg_dump orders by OID  (Alexander Lakhin <exclusion@gmail.com>)
Responses Re: Test instability when pg_dump orders by OID
List pgsql-hackers
Hi all!

On Sun, 10 Aug 2025 at 12:00, Alexander Lakhin <exclusion@gmail.com> wrote:
>
> Hello Noah,
>
> 04.08.2025 03:03, Noah Misch wrote:
> > Pushed as 0decd5e.  ...
>
> Please look at a new anomaly introduced with that commit. The following
> script:
> createdb regression
>
> echo "
> CREATE USER u1;
> ALTER DEFAULT PRIVILEGES FOR ROLE u1 REVOKE INSERT ON TABLES FROM u1;
>
> CREATE USER u2;
> ALTER DEFAULT PRIVILEGES FOR ROLE u2 REVOKE INSERT ON TABLES FROM u2;
> " | psql regression
>
> pg_dump regression
>
> triggers:
> pg_dump: pg_dump_sort.c:454: DOTypeNameCompare: Assertion `0' failed.

I reproduced this. Indeed, in case of default acl we happen to use OID sort.

PFA resolves this issue. I simply added DEFAULT ACL case-specific
tiebreaker that resolves object order.

-- 
Best regards,
Kirill Reshke

Attachment

pgsql-hackers by date:

Previous
From: Jingtang Zhang
Date:
Subject: Possible inaccurate description of wal_compression in docs
Next
From: jian he
Date:
Subject: Re: Emitting JSON to file using COPY TO