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? "Dave Page" <dpage@vale-housing.co.uk>
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      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
Дата:
От: Dave Page
Дата:
FAQ