Skip site navigation (1) Skip section navigation (2)

BUG #3811: Getting multiple values from a sequence generator

From: "Adriaan van Os" <postgres(at)microbizz(dot)nl>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3811: Getting multiple values from a sequence generator
Date: 2007-12-09 09:24:34
Message-ID: 200712090924.lB99OY8t024849@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
The following bug has been logged online:

Bug reference:      3811
Logged by:          Adriaan van Os
Email address:      postgres(at)microbizz(dot)nl
PostgreSQL version: 8.2.5
Operating system:   Mac OS X 10.5
Description:        Getting multiple values from a sequence generator
Details: 

The following has been observed In Postgres 8.2.5

1. LOCK TABLE doesn't work on a sequence
2. nextval will happily ignore ISOLATION LEVEL SERIALIZABLE of concurrent
transactions
3. nextval doesn't have an optional "increase" parameter (the increase is
always one).

Therefore, there is no way (I know of) to prevent a concurrent nextval
between a nextval and a setval call. Consequently, it is not possible to
create an atomic operation that increases nextval by a value N > 1.

I suggest an optional "increase" parameter to the nextval function. This can
make a certain kind of bulk operation and bulk import much more efficient.

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2007-12-09 12:13:58
Subject: Re: Release Note Changes
Previous:From: Andrew DunstanDate: 2007-12-09 04:54:49
Subject: Re: Bad security practice in oid2name and pgbench

pgsql-bugs by date

Next:From: Martin PittDate: 2007-12-09 10:43:48
Subject: Re: BUG #3809: SSL "unsafe" private key permissions bug
Previous:From: Andrew DunstanDate: 2007-12-09 02:04:04
Subject: Re: [HACKERS] BUG #3799: csvlog skips some logs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group