insert two tables taking serial from table1 - Mailing list pgsql-general

From Jim (s/nosp@m/@/ to reply)
Subject insert two tables taking serial from table1
Date
Msg-id rq7l9.472105$_91.685798@rwcrnsc51.ops.asp.att.net
Whole thread Raw
Responses Re: insert two tables taking serial from table1  (Tino Wildenhain <tino@wildenhain.de>)
List pgsql-general
I've been looking around for a way to set up an insert to table 1 then take
the serial from table 1 that autoincrimented and add it to table 2. I've
seen ways people have done it by grabbing last row of the table but I am
concerned about a connection that doesn't need to add to table 2 inserting
into the last table  before table 1 can be queried. and thus getting the
relation to the wrong row. Is there a way to get the oid from the insert?
using php incase that helps.


thought about doing an exact search on what was just inserted but table has
possibility of users adding exactly the same data. have thought about
combining the tables but don't want an overgrown table with more rows then I
can maneuver through.

thanks in advance for any help.
Jim



pgsql-general by date:

Previous
From: Daniel Morgan
Date:
Subject: Re: Feature comparison between Postgresql, Oracle and Mysql ?
Next
From: "Peter Kovacs"
Date:
Subject: Re: [JDBC] Prepared statement performance...