Re: [Q] Sequences, last_value and inserts

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: marie.tuite@edisonaffiliates.com
Cc: "Doug McNaught" <doug@mcnaught.org>, "Roderick A. Anderson" <raanders@acm.org>, "Bruno Wolff III" <bruno@wolff.to>, pgsql-general@postgresql.org
Date: 2002-11-01T20:58:36Z
Lists: pgsql-general
"Marie G. Tuite" <marie.tuite@edisonaffiliates.com> writes:
> select last_value from domain_info_tbl_key_seq; 
> This returns the same value as currval.

Au contraire --- the values are not necessarily the same, for exactly
the reason the OP was concerned about.  last_value will be the last
value any backend got from nextval(); currval is the last value *your*
backend got from nextval().

			regards, tom lane