Re: [HACKERS] Patch for pg_dump (6.4) inheritance bug - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Patch for pg_dump (6.4) inheritance bug
Date
Msg-id 19625.912896999@sss.pgh.pa.us
Whole thread Raw
In response to Patch for pg_dump (6.4) inheritance bug  ("Oliver Elphick" <olly@lfix.co.uk>)
List pgsql-hackers
"Oliver Elphick" <olly@lfix.co.uk> writes:
> It seems to work, at least for my database, so here is a patch:
> [ patch to prevent dumping of inherited constraints snipped ]

I have applied this patch to both the main CVS tree and REL6_4 branch,
along with Constantin Teodorescu's suggestion to improve the formatting
of pg_dump's CREATE TABLE commands, and some work of my own to stop
an occasional coredump in pg_dump -z.

FYI, I was able to simplify your query for fetching non-inherited
checks; it now looks like:

sprintf(query, "SELECT rcname, rcsrc from pg_relcheck "    "where rcrelid = '%s'::oid "    "   and not exists "    "
(select* from pg_relcheck as c, pg_inherits as i "    "   where i.inhrel = pg_relcheck.rcrelid "    "     and c.rcname
=pg_relcheck.rcname "    "     and c.rcsrc = pg_relcheck.rcsrc "    "     and c.rcrelid = i.inhparent) ",
tblinfo[i].oid);

        regards, tom lane


pgsql-hackers by date:

Previous
From: "Oliver Elphick"
Date:
Subject: Parser bug (?)
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Parser bug (?)