Re: [HACKERS] Patch for pg_dump (6.4) inheritance bug

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Patch for pg_dump (6.4) inheritance bug
Date: 1998-12-05 22:29:59
Message-ID: 19625.912896999@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Oliver Elphick" <olly(at)lfix(dot)co(dot)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

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1998-12-06 00:27:33 Re: [HACKERS] Parser bug (?)
Previous Message Oliver Elphick 1998-12-05 19:57:15 Parser bug (?)