Re: Dependencies for partitioned indexes are still a mess
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2020-08-12T22:48:28Z
Lists: pgsql-hackers
Attachments
- add-recursive-deps.patch (text/x-diff) patch
On 2020-Jul-15, Tom Lane wrote: > Issue #2: parallel restore does not work > > 1. dropdb r2; createdb r2 > 2. pg_restore -j8 -d r2 regression.dump > > This is fairly timing-dependent, but some attempts fail with messages > like > > pg_restore: while PROCESSING TOC: > pg_restore: from TOC entry 6684; 2606 29166 FK CONSTRAINT fk fk_a_fkey postgres > pg_restore: error: could not execute query: ERROR: there is no unique constraint matching given keys for referenced table "pk" > Command was: ALTER TABLE fkpart3.fk > ADD CONSTRAINT fk_a_fkey FOREIGN KEY (a) REFERENCES fkpart3.pk(a); Hmm, we do make the FK constraint depend on the ATTACH for the direct children; what I think we're lacking is dependencies on descendants twice-removed (?) or higher. This mock patch seems to fix this problem by adding dependencies recursively on all children of the index; I no longer see this problem with it. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Fix typo in comment
- fcc42756818c 12.5 landed
- 70ccff88d910 11.10 landed
- 352b8cf59f40 13.0 landed
- 05c16b827f3a 14.0 landed
-
pg_dump: fix dependencies on FKs to partitioned tables
- b7cc21c57d73 13.0 landed
- 3dadcb2b3194 12.5 landed
- 2ba5b2db7943 14.0 landed