]> granicus.if.org Git - postgresql/commit
Mark index-constraint comments with correct dependency in pg_dump.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Jun 2013 17:55:04 +0000 (13:55 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Jun 2013 17:55:04 +0000 (13:55 -0400)
commit50e66d37aceee0f38c44f41834f39cfdda34c796
treed6e855ccaf0df303b9e946d90cf46b284435b997
parentc204aba26ce0c7efeaac193d274742423074bbd3
Mark index-constraint comments with correct dependency in pg_dump.

When there's a comment on an index that was created with UNIQUE or PRIMARY
KEY constraint syntax, we need to label the comment as depending on the
constraint not the index, since only the constraint object actually appears
in the dump.  This incorrect dependency can lead to parallel pg_restore
trying to restore the comment before the index has been created, per bug
#8257 from Lloyd Albin.

This patch fixes pg_dump to produce the right dependency in dumps made
in the future.  Usually we also try to hack pg_restore to work around
bogus dependencies, so that existing (wrong) dumps can still be restored in
parallel mode; but that doesn't seem practical here since there's no easy
way to relate the constraint dump entry to the comment after the fact.

Andres Freund
src/bin/pg_dump/pg_dump.c