Robert Treat <xzilla(at)users(dot)sourceforge(dot)net> writes:
> On Thu, 2002-09-26 at 17:22, Tom Lane wrote:
>> Robert Treat <xzilla(at)users(dot)sourceforge(dot)net> writes:
> I'm trying to think of the cases where this extraction might fail, but
> maybe more important is what happens if it does fail?
>> Then you have broken RI triggers ... which is the problem now.
> Uh...yeah, I got that part. I meant what will be done if/when it fails?
> Throw a WARNING and keep going? Throw an ERROR and die?
What I was thinking of was to do the following in CREATE CONSTRAINT
if (no FROM clause)
try to extract table name from given tgargs;
try to look up table OID;
if successful, insert table OID into tgconstrrelid;
If the lookup fails, you'd be left creating a constraint trigger with
zero tgconstrrelid, which is what's happening now. That would error
out upon use (if it's really an RI trigger), thus alerting you that
you have a broken trigger. (We could add a couple of lines in the
RI triggers to cause the error message to be more helpful than
"Relation 0 not found".)
regards, tom lane
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2002-09-26 22:25:23|
|Subject: Re: Reconstructing FKs in pg_dump |
|Previous:||From: Stephan Szabo||Date: 2002-09-26 22:10:35|
|Subject: Re: Reconstructing FKs in pg_dump|