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

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Foreign key bugs (Re: [BUGS] "New" bug?? Serious - crashesbackend.)
Дата
Msg-id 026001bfeb86$48510ec0$0c64010a@kick.com
обсуждение исходный текст
Ответ на Re: Foreign key bugs (Re: [BUGS] "New" bug?? Serious - crashes backend.)  (JanWieck@t-online.de (Jan Wieck))
Список pgsql-hackers
> "Stephan Szabo" <sszabo@kick.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.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: update on TOAST status'
Следующее
От: "Stephan Szabo"
Дата:
Сообщение: Re: Foreign key bugs + other problems