Charlie,

> Lets say I need to insert a row into the master table and N rows into the 
> detail table. After inserting a row into master, and before detail, I need 
to 
> read the master table to obtain the value of the id for the row just 
> inserted, so I can insert this id as the foreign key value for the N rows in 
> the detail table. 

Hey, what about CURRVAL('sequence_name')?

-- 
-Josh Berkus


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to