Skip site navigation (1) Skip section navigation (2)

Re: get sequence value of insert command

From: Richard Huxton <dev(at)archonet(dot)com>
To: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
Cc: Erik Thiele <erik(at)thiele-hydraulik(dot)de>, pgsql-sql(at)postgresql(dot)org
Subject: Re: get sequence value of insert command
Date: 2004-11-19 09:26:52
Message-ID: 419DBC5C.807@archonet.com (view raw or flat)
Thread:
Lists: pgsql-sql
Achilleus Mantzios wrote:
>>
>>now how do i know the id of my newly inserted element? and
>>how can this be done in a completely concurrency safe way?
> 
> 
> The way to do this is by reading the docs :)
> 
> use currval, it is session safe.

The increase in this question suggests the number of new users has 
increased since 8.0 went into beta-test. It's pretty much the first 
question anyone asks.

I seem to recall it was mine. I made the mistake of assuming it wasn't 
concurrency safe and was gently corrected by one of the community. I 
think it might have been a Tim/Tam Lane. Wonder what happened to him? :-)

-- 
   Richard Huxton
   Archonet Ltd

In response to

Responses

pgsql-sql by date

Next:From: Achilleus MantziosDate: 2004-11-19 09:37:53
Subject: Re: get sequence value of insert command
Previous:From: Michael GlaesemannDate: 2004-11-19 09:20:21
Subject: Re: get sequence value of insert command

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group