pgsql: Mark index-constraint comments with correct dependency in pg_dum

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Mark index-constraint comments with correct dependency in pg_dum
Date: 2013-06-27 17:55:47
Message-ID: E1UsGQ7-00077Y-Os@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/76ce043bb57abb0b643d95094a25136110a6cb44

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2013-06-27 19:05:22 pgsql: Permit super-MaxAllocSize allocations with MemoryContextAllocHug
Previous Message Tom Lane 2013-06-27 16:38:08 pgsql: Expect EWOULDBLOCK from a non-blocking connect() call only on Wi