Re: key = currval('tab_key_seq') choses SEQSCAN?! - Mailing list pgsql-general

From Eric B.Ridge
Subject Re: key = currval('tab_key_seq') choses SEQSCAN?!
Date
Msg-id 9D0E600A-6803-11D8-9391-000A95D98B3E@tcdi.com
Whole thread Raw
In response to Re: key = currval('tab_key_seq') choses SEQSCAN?!  (Joe Conway <mail@joeconway.com>)
Responses Re: key = currval('tab_key_seq') choses SEQSCAN?!  (Joe Conway <mail@joeconway.com>)
List pgsql-general
On Feb 25, 2004, at 9:07 PM, Joe Conway wrote:

> Eric B.Ridge wrote:
>> I suppose this is obvious, but it's volatile because *other* backends
>> can change it while the current transaction is still in progress?
>
> No. Other backends don't affect currval, but your own might on a
> row-by-row basis. Consider:

gotcha.  Stated differently, it's not volatile because, by design, it
doesn't always produce the same output for the same input.

> regression=# select nextval('seq'), currval('seq'), s from
> generate_series(1,4) as t(s);

OT:  generate_series looks useful.  Is this only in 7.5?

eric


pgsql-general by date:

Previous
From: Joe Conway
Date:
Subject: Re: key = currval('tab_key_seq') choses SEQSCAN?!
Next
From: Shelby Cain
Date:
Subject: Re: select statement against pg_stats returns inconsistent data