Re: ADD/DROP constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ADD/DROP constraints
Date: 2006-06-08 21:42:46
Message-ID: 1916.1149802966@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)edu> writes:
> Or maybe I should insist that a matching constraint name be present *and* that
> the source text match? That's more of a pain to code though.

Yeah, that's what I'd go with. I believe that there are bits of the
system (probably in pg_dump) that look *only* at the constraint name
when deciding what's inherited. (This is of course bogus, but until
someone does something about coninhcount it's going to be hard to
have a non-bogus solution.) Allowing a name mismatch would be bad.

One other point is that you should NOT rely on consrc. See the note
at the bottom of
http://developer.postgresql.org/docs/postgres/catalog-pg-constraint.html
(Someday we should get rid of consrc altogether.) Unfortunately it
won't do to compare conbin either, because that will contain column
numbers that won't necessarily match. I fear you'll have to actually
reverse-compile the conbin strings and see if you get a match.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-06-08 21:52:54 Re: ADD/DROP constraints
Previous Message Jim C. Nasby 2006-06-08 21:39:45 Re: That EXPLAIN ANALYZE patch still needs work