Skip site navigation (1) Skip section navigation (2)

Re: Bug in pg_get_constraintdef (for deferrable constraints)

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Magnus Hagander <mha(at)sollentuna(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in pg_get_constraintdef (for deferrable constraints)
Date: 2003-01-01 21:47:34
Message-ID: 20030101133815.Y81242-200000@megazone23.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Wed, 1 Jan 2003, Bruce Momjian wrote:

> Tom Lane wrote:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > I see the values being stored on constriant creation, but not being used
> > > anywhere:
> >
> > I believe the values that actually get inspected at runtime are the
> > tgdeferrable and tginitdeferred fields in pg_trigger.  The columns in
> > pg_constraint are just copies of these.
> >
> > It is not real clear to me whether it should be allowed to alter the
> > deferrability status of a foreign-key constraint --- is that in the spec?
>
> The big problem is that while pg_dump's dump_trigger() looks at
> tginitdeferred and dumps accordingly, pg_get_constraintdef doesn't look
> at tginitdeferred, and therefore doesn't record the requirement as part
> of ALTER TABLE ADD CONSTRAINT.

pg_get_constraintdef should probably be looking at condeferrable
and condeferred in the pg_constraint row it's looking at.  Maybe something
like the attached.

Attachment: get_constraints.patch
Description: text/plain (629 bytes)

In response to

Responses

pgsql-hackers by date

Next:From: mlwDate: 2003-01-01 23:02:12
Subject: Re: PostgreSQL Password Cracker
Previous:From: Bruce MomjianDate: 2003-01-01 21:15:53
Subject: Re: Bug in pg_get_constraintdef (for deferrable constraints)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group