Re: Using a trigger with an object-relational manager - Mailing list pgsql-general

From PFC
Subject Re: Using a trigger with an object-relational manager
Date
Msg-id op.tsr5qnlccigqcu@apollo13
Whole thread Raw
In response to Using a trigger with an object-relational manager  (Rick Schumeyer <rschumeyer@ieee.org>)
List 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 by date:

Previous
From: Richard Huxton
Date:
Subject: Re: OIDs - file objects, are damaged by PostgreSQL.
Next
From: Rick Schumeyer
Date:
Subject: Re: Using a trigger with an object-relational manager