currval question - Mailing list pgsql-general

From Andy Kriger
Subject currval question
Date
Msg-id OJEFIHHAALOBKKJEOMBDAEAGCAAA.akriger@greaterthanone.com
Whole thread Raw
Responses Re: currval question  (Tino Wildenhain <tino@wildenhain.de>)
Re: currval question  (Garo Hussenjian <garo@xapnet.com>)
Re: currval question  (Jason Earl <jason.earl@simplot.com>)
Re: currval question  ("Andy Kriger" <akriger@greaterthanone.com>)
List 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



pgsql-general by date:

Previous
From: Cindy
Date:
Subject: Re: question regarding regular expressions
Next
From: Tino Wildenhain
Date:
Subject: Re: question regarding regular expressions