Re: [Q] Sequences, last_value and inserts - Mailing list pgsql-general

From Tom Lane
Subject Re: [Q] Sequences, last_value and inserts
Date
Msg-id 7214.1036184316@sss.pgh.pa.us
Whole thread Raw
In response to Re: [Q] Sequences, last_value and inserts  ("Marie G. Tuite" <marie.tuite@edisonaffiliates.com>)
List 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

pgsql-general by date:

Previous
From: "Booth, Robert"
Date:
Subject: Re: Update FROM clause?
Next
From: Bruno Wolff III
Date:
Subject: Re: [Q] Sequences, last_value and inserts