Re: Foreign key bugs (Re: [BUGS] "New" bug?? Serious - crashesbackend.)

From: "Stephan Szabo" <sszabo(at)kick(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Foreign key bugs (Re: [BUGS] "New" bug?? Serious - crashesbackend.)
Date: 2000-07-11 22:20:56
Message-ID: 026001bfeb86$48510ec0$0c64010a@kick.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

> "Stephan Szabo" <sszabo(at)kick(dot)com> writes:
> > Also, I realized something else that is a little wierd. When a
temporary
> > table shadows a permanent table that you've made a foreign key reference
> > to, which table should it be going to check the constraint?
>
> Seems to me it should certainly be going to the permanent table, which
> is another argument in favor of making the link via OID not table name.
> The existing code will get this wrong.

Can I force the SPI query that's being generated to use the permanent
table rather than the shadowed table when they have the same name?
If not, then storing the oid isn't sufficient without moving away from
SPI. I do agree that storing the oids is a good idea (and am planning to
change it unless someone comes up with a compelling reason not to)
since the only way via something like SPI that I can think of is once
we have schemas, using schemaname.tablename which may not be
shadowed by the temp table and it'll just be easier for everyone
involved if we store the oid.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephan Szabo 2000-07-11 22:24:50 Re: Foreign key bugs + other problems
Previous Message Jan Wieck 2000-07-11 22:18:20 Re: Foreign key bugs (Re: [BUGS] "New" bug?? Serious - crashesbackend.)

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2000-07-11 22:24:50 Re: Foreign key bugs + other problems
Previous Message Tom Lane 2000-07-11 22:18:26 Re: update on TOAST status'