last id - Mailing list pgsql-novice

From Ramil G. Sagum
Subject last id
Date
Msg-id 1056685295.7712.19.camel@arwen.hq.astra.ph
Whole thread Raw
In response to Re: Best Practice??  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: last id  (Josh Berkus <josh@agliodbs.com>)
List pgsql-novice
is there a way to

1. insert a row to table A
2. get the value of the serial field from the now in no.1
3. insert a row to table B (one of the fields uses the value from no.2)

in -one transaction-?

i'm currently doing it using functions, but is there another way?
(kind of like the mysql_insert_id function in mysql)




ramil



pgsql-novice by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Address Table
Next
From: Josh Berkus
Date:
Subject: Re: last id