Re: Using a trigger with an object-relational manager

Поиск
Список
Период
Сортировка
От PFC
Тема Re: Using a trigger with an object-relational manager
Дата
Msg-id op.tsr5qnlccigqcu@apollo13
обсуждение исходный текст
Ответ на Using a trigger with an object-relational manager  (Rick Schumeyer <rschumeyer@ieee.org>)
Список pgsql-general
On Wed, 23 May 2007 14:41:00 +0200, Rick Schumeyer <rschumeyer@ieee.org>
wrote:

> Actually, the situation is slightly more complicated.  It's more like I
> have tables A1, A2, and A3 each of which must have a corresponding row
> in B.  So each of A1, A2 and A3 has a BEFORE INSERT trigger that creates
> a row in B and sets a FK in A1 (or A2 or A3).  So I can't just use the
> same PK in both the A tables and B.

    It's a hack, but A1, A2, A3 etc could all use the same sequence to
generate their PK...

    The best would be to patch rails so it uses INSERT RETURNING.

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: OIDs - file objects, are damaged by PostgreSQL.
Следующее
От: Rick Schumeyer
Дата:
Сообщение: Re: Using a trigger with an object-relational manager