Re: get sequence value of insert command

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Erik Thiele <erik(at)thiele-hydraulik(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: get sequence value of insert command
Date: 2004-11-19 09:20:21
Message-ID: 3CE4C46C-3A0C-11D9-8C65-000A95C88220@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Nov 19, 2004, at 5:41 PM, Erik Thiele 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?

This is a FAQ (4.15.1, among others). See currval() and nextval() in
the documentation as well.

Michael Glaesemann
grzm myrealbox com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2004-11-19 09:26:52 Re: get sequence value of insert command
Previous Message Erik Thiele 2004-11-19 08:41:34 get sequence value of insert command