Re: currval question
От
Garo Hussenjian
Тема
Re: currval question
Дата
Msg-id
B9ABAA6D.35CE%garo@xapnet.com
Ответ на
currval question (Andy Kriger)
Список
Дерево обсуждения
currval question "Andy Kriger" <akriger@greaterthanone.com>
Re: currval question Tino Wildenhain <tino@wildenhain.de>
Re: currval question Jason Earl <jason.earl@simplot.com>
Re: currval question Garo Hussenjian <garo@xapnet.com>
Re: currval question "Andy Kriger" <akriger@greaterthanone.com>
Andy, I don't know exactly what's under the hood, but I know that currval() won't even return a result unless you've used nextval() in your session. If currval() did not operate solely within the scope of the session, it stands to reason that it would return a result... It's behavior (from the driver's seat) is consistent with a well conceived concurrency model. This should be easy enough to test with a couple of terminals. My money is on Postgres! :) Regards, Garo. on 9/16/02 3:14 PM, Andy Kriger at akriger@greaterthanone.com wrote: > 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 > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html > =-=-==-=-=-== Xapnet Internet Solutions 1501 Powell St., Suite N Emeryville, CA 94608 Tel - (510) 655-9771 Fax - (510) 655-9775 Web - http://www.xapnet.com
В списке pgsql-general по дате отправления