currval question

From: "Andy Kriger" <akriger(at)greaterthanone(dot)com>
To: "Pgsql-General" <pgsql-general(at)postgresql(dot)org>
Subject: currval question
Date: 2002-09-16 22:14:07
Message-ID: OJEFIHHAALOBKKJEOMBDAEAGCAAA.akriger@greaterthanone.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to get the last value updated by an column auto-incrementing
with nextval(). In MySQL, you'd use LAST_INSERT_ID() - in Postgre, currval()
appears to do the trick.

Is this maintained on a per-connection basis? For example, user A inserts
and the nextval() updates to 5, user B does 2 inserts, updating nextval() to
7. When user A calls currval() they should get 5 if the updates are per-cnx.
What does psql do under the hood here?

thx
a

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2002-09-16 22:18:40 Re: question regarding regular expressions
Previous Message Cindy 2002-09-16 22:07:46 Re: question regarding regular expressions