last id

From: "Ramil G(dot) Sagum" <ramil(at)astra(dot)ph>
To: pgsql-novice(at)postgresql(dot)org
Subject: last id
Date: 2003-06-27 03:41:35
Message-ID: 1056685295.7712.19.camel@arwen.hq.astra.ph
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2003-06-27 04:28:56 Re: last id
Previous Message Josh Berkus 2003-06-27 03:10:33 Re: Address Table