Foreign key bugs (Re: "New" bug?? Serious - crashes backend.)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ryan <ryan(at)bel(dot)bc(dot)ca>
Cc: pgsql-bugs(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Foreign key bugs (Re: "New" bug?? Serious - crashes backend.)
Date: 2000-07-11 03:26:38
Message-ID: 14790.963285998@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

ryan <ryan(at)bel(dot)bc(dot)ca> writes:
> I have a database which reliable crashes the database system. When you
> try to do insert/update on the table 'machines' the backend crashes with
> what I think is signal 11.

The problem seems to be that you have a foreign-key trigger on
'machines' which refers to a non-existent primary-key relation:

> CREATE CONSTRAINT TRIGGER "siteid" AFTER INSERT OR UPDATE ON
> "machines" NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE
> PROCEDURE "RI_FKey_check_ins" ('siteid', 'machines', 'site',
> 'UNSPECIFIED', 'sites', 'siteid');

The 'site' argument is the name of the referenced table, and you
have no table named site.

There are at least two bugs here: the immediate cause of the crash
is lack of a check for heap_openr() failure in the RI trigger code,
but a larger question is why the system let you drop a table that
is the target of a referential integrity check (which I assume is
what you did to get into this state).

Anyway, dropping the siteid trigger, as well as any others that
refer to gone tables, ought to get you out of trouble for now.
Meanwhile the foreign-key boys have some work to do ...

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jan Wieck 2000-07-11 09:20:19 Re: [HACKERS] Foreign key bugs (Re: "New" bug?? Serious - crashes backend.)
Previous Message Bruce Momjian 2000-07-11 02:23:38 Re: ps_status.h on FreeBSD 4.0 problems and fix

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Bitmead 2000-07-11 03:46:42 Re: postgres 7.2 features.
Previous Message Tom Lane 2000-07-11 03:11:48 Re: postgres fe/be protocol