On Wed, 23 May 2007 14:41:00 +0200, Rick Schumeyer <rschumeyer(at)ieee(dot)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.