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

Re: PLSQL Question regarding multiple inserts

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Humble Geek <humblegeek(at)rogers(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PLSQL Question regarding multiple inserts
Date: 2004-02-28 20:40:06
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Wed, Feb 25, 2004 at 04:11:37AM +0000, Humble Geek wrote:
> Assume XXX is the id from the first insert. How do I get that number? Not
> currval('someSeq') -  'cause someone else may have performed an insert - but
> the id for that specific insert.

Read the documentation carefully, currval() does what you want, it
isn't affected by concurrent inserts.

Martijn van Oosterhout   <kleptog(at)svana(dot)org>
> If the Catholic church can survive the printing press, science fiction
> will certainly weather the advent of bookwarez.
> - Cory Doctorow

In response to

pgsql-general by date

Next:From: Mike FuterkoDate: 2004-02-28 21:12:11
Subject: pgCluster in production environment
Previous:From: Karl O. PincDate: 2004-02-28 20:38:08
Subject: Triggers per transaction, workaround? prospects?

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