Re: [Q] Sequences, last_value and inserts

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: marie(dot)tuite(at)edisonaffiliates(dot)com
Cc: "Doug McNaught" <doug(at)mcnaught(dot)org>, "Roderick A(dot) Anderson" <raanders(at)acm(dot)org>, "Bruno Wolff III" <bruno(at)wolff(dot)to>, pgsql-general(at)postgresql(dot)org
Subject: Re: [Q] Sequences, last_value and inserts
Date: 2002-11-01 20:58:36
Message-ID: 7214.1036184316@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Marie G. Tuite" <marie(dot)tuite(at)edisonaffiliates(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2002-11-01 21:17:55 Re: [Q] Sequences, last_value and inserts
Previous Message Paul Ottar Tornes 2002-11-01 20:54:18 Norwegian Letters