I wrote: > Barring objections or better ideas, I'll push forward with applying > this patch and the dependency-fixup patch.
Applied and back-patched. BTW, I had complained at the end of the pgsql-bugs thread about bug #6699 that it seemed like FK constraints would get prevented from being restored in parallel fashion if they depended on a constraint-style unique index, because the dependency for the FK constraint would reference the index's dump ID, which is nowhere to be seen in the dump. But in fact they are restored in parallel, and the reason is that pg_restore silently ignores any references to unknown dump IDs (a hack put in specifically because of the bogus dependency data, no doubt). So that raises the opposite question: how come pg_restore doesn't fall over from trying to create the FK constraint before the unique index it depends on is created? And the answer to that is dumb luck, more or less. The "locking dependencies" hack in pg_restore knows that creation of an FK constraint requires exclusive lock on both tables, so it won't try to restore the FK constraint before creation of the constraint-style index is done. So getting the dependency information fixed is a necessary prerequisite for any attempt to reduce the locking requirements there. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers