Re: Bug in RI

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jeroen van Vianen <jeroen(dot)van(dot)vianen(at)satama(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bug in RI
Date: 2000-09-22 17:03:16
Message-ID: Pine.BSF.4.10.10009220956550.66920-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Actually, current sources already work better (well, elog rather
than crash).

Eventually, the triggers will reference things by OID rather
than name so renames will work. I'd also like to make the
dependencies known so we can make it work properly when
drop column gets implemented. No known eta at this point
though.

Stephan Szabo
sszabo(at)bigpanda(dot)com

On Fri, 22 Sep 2000, Jeroen van Vianen wrote:

> At 21:13 21-9-00 -0700, Stephan Szabo wrote:
> >This is a one line patch that will throw a notice with
> >what relation name it's trying to open and what it
> >got back in RI_FKey_keyequal_upd. It should say
> >the name of your table and a number, but I expect
> >the number will be 0.
>
> Yes, it is. So I also found the error: I did a rename table and the
> constraint triggers were not updated with the new table name.
>
> Maybe a little check should be built in to check for fkey == 0, like this
> (from the top of my head, no actual checking):
>
> fk_rel = heap_openr(tgargs[RI_FK_RELNAME_ARGNO], NoLock);
> + if (fk_rel == NULL) {
> + elog(ERROR, "In foreign key constraint, cannot open relname: %s",
> + tgargs[RI_FK_RELNAME_ARGNO]);
> + }
> pk_rel = trigdata->tg_relation;
> new_row = trigdata->tg_newtuple;
> old_row = trigdata->tg_trigtuple;

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2000-09-22 20:21:38 Re: PQsetdbLogin
Previous Message Tom Lane 2000-09-22 16:55:01 Re: Weird Tcl/Tk configuration