hi, there!
On Mon, 22 Jan 2001, Bruce Momjian wrote:
> Can someone comment on this?
I have got more comments from Constantin: current implementation will fail
(return too many rows) if one table has two foreign keys, e.g.:
CREATE TABLE prim(i integer PRIMARY KEY);
CREATE TABLE f(i integer REFERENCES prim, j integer REFERENCES prim);
> > how about this?
> >
> > --- cut here ---
> > >From cs@plesk.com Sat Dec 16 15:08:40 2000
> > Date: Thu, 14 Dec 2000 17:00:43 +0600 (NOVT)
> > From: Constantin S. Svintsoff <cs@plesk.com>
> > To: fjoe@iclub.nsu.ru
> > Subject: Bug in SQLForeignKeys()
> >
> >
> > Query used for checking foreign key triggers
> > returns too many results when there're more than one foreign
> > key in a table. It happens because only table's oid is used to
> > link between pg_trigger with INSERT check and pg_trigger with
> > UPDATE/DELETE check.
> >
> > I think there should be enough to add following conditions
> > into WHERE clause of that query:
> > AND pt.tgconstrname = pg_trigger.tgconstrname
> > AND pt.tgconstrname = pg_trigger_1.tgconstrname
> >
> > /Constantin
> > --- cut here ---
/fjoe