pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Achilleus Mantzios <achill@matrix.gatewaynet.com>
Cc: Erik Thiele <erik@thiele-hydraulik.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: get sequence value of insert command
Date: Fri, 19 Nov 2004 09:26:52 +0000
Message-ID: <419DBC5C.807@archonet.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0411191136220.13400-100000@matrix.gatewaynet.com>
References: <Pine.LNX.4.44.0411191136220.13400-100000@matrix.gatewaynet.com>

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



view thread (8+ messages)  latest in thread

Message-ID: <419DBC5C.807@archonet.com>
Permalink:  ../419DBC5C.807@archonet.com/
Also on:    postgresql.org/message-id/419DBC5C.807@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, achill@matrix.gatewaynet.com, erik@thiele-hydraulik.de
  Subject: Re: get sequence value of insert command
  In-Reply-To: <419DBC5C.807@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox