On 2026-Nov-26, Raja Sai pranav wrote:
> Yes, thanks. I reproduced it: a master pg_dump of this schema from 18.7
> fails to restore into master with the same error. It doesn't need
> pg_upgrade or an older server, though: creating the schema on master
> and doing a plain pg_dump / psql restore into another master database
> fails the same way.
>
> pg_dump emits both NOT VALID constraints as separate ALTER TABLE ... ADD
> CONSTRAINT commands after the data, parent first. Adding "nn" to the
> parent recurses and gives the child an inherited constraint named "nn",
> so the child's own command then fails the name check added by 96e2af605.
Interesting.
> I'll look into a fix, unless Álvaro would rather handle it.
Please go ahead.
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/