Re: get a pkey/id back from/after an insert

From: "Corey" <corey(at)bitworthy(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: get a pkey/id back from/after an insert
Date: 2006-06-19 21:18:01
Message-ID: 200606191418.01103.corey@bitworthy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Monday 19 June 2006 13:40, Corey wrote:
<snip>
> I'm using the perl dbi interface to postgres, and I'm wondering how
> people do the following:
>
> insert a row into a table, and then immediately get back the pkey/id
> of the row, so that I can then use this id to insert into another related
> table.
>

Ok, so of course, a few more minutes of searching/reading/googling,
and I found the answer to my own question:

currval()/nextval()

Sorry for the noise!

Cheers,

Corey

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Richard Broersma Jr 2006-06-19 22:00:53 Re: get a pkey/id back from/after an insert
Previous Message Corey 2006-06-19 20:40:40 get a pkey/id back from/after an insert