Re: FKs on temp tables: hard, or just omitted?

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: FKs on temp tables: hard, or just omitted?
Дата
Msg-id 20051029131313.GD17490@svana.org
обсуждение исходный текст
Ответ на Re: FKs on temp tables: hard, or just omitted?  ("Sander Steffann" <steffann@nederland.net>)
Ответы Re: FKs on temp tables: hard, or just omitted?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, Oct 29, 2005 at 02:54:31PM +0200, Sander Steffann wrote:
> >You can have foreign keys between temp tables, just not between temp and
> >permanent tables.  The latter case is either fairly silly, or
> >technically hard, depending on which direction you have in mind.
>
> A temp table referencing a permanent table wouldn't be very silly IMHO...
> Sander.

Ok, say someone in another backend deletes a row from the parmanent
table, how do they check that no appropriate rows exist in the temp
table? A foreign keys involves triggers on both the source and target
tables.

You solve it by allowing other backends to lock and examine your
temporary tables. But AIUI temporary tables are not stored in shared
memory so how do you get a consistant view of it?

Not unsolvable, but very tricky.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

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

Предыдущее
От: "Sander Steffann"
Дата:
Сообщение: Re: FKs on temp tables: hard, or just omitted?
Следующее
От: "Dave Page"
Дата:
Сообщение: Re: FKs on temp tables: hard, or just omitted?