Boszormenyi Zoltan schrieb:
Thomas Guettler írta:
Hi,
how can you get N numbers (without holes) from a sequence?
# create sequence tmp_seq cache 1000;
Hi,
alter SEQUENCE ... cache 100 survives a rollback. That's something I like to
avoid:
foo_esg_modw=# select * from foo_isu_isu_id_seq;
Thomas Guettler schrieb:
Hi,
how can you get N numbers (without holes) from a sequence?
If sequences could be locked like tables, it would be easy.
In old versions of postgres it worked:
http://archives.postgresql.org//pgsql-hackers/2001-10/msg00930.php
Thomas
--
Thomas Guettler,
On Wed, May 20, 2009 at 3:00 AM, Thomas Guettler h...@tbz-pariv.de wrote:
Thomas Guettler schrieb:
Hi,
how can you get N numbers (without holes) from a sequence?
If sequences could be locked like tables, it would be easy.
advisory locks are superior for locking sequences in almost every
On Tue, May 19, 2009 at 12:45 PM, Thomas Guettler h...@tbz-pariv.de wrote:
Hi,
how can you get N numbers (without holes) from a sequence?
generate_series(), or make sure there's only one connection, no
transactions rollback.
--
GJ
--
Sent via pgsql-general mailing list
hubert depesz lubaczewski schrieb:
On Tue, May 19, 2009 at 01:45:17PM +0200, Thomas Guettler wrote:
how can you get N numbers (without holes) from a sequence?
alter sequence XXX increment by 1000;
select nextval('XXX');
alter sequence XXX increment by 1;
If other processes run nextval()
On Tue, May 19, 2009 at 01:45:17PM +0200, Thomas Guettler wrote:
how can you get N numbers (without holes) from a sequence?
alter sequence XXX increment by 1000;
select nextval('XXX');
alter sequence XXX increment by 1;
Best regards,
depesz
--
Linkedin: http://www.linkedin.com/in/depesz /
On Tue, May 19, 2009 at 03:32:16PM +0200, Thomas Guettler wrote:
If other processes run nextval() between increment by 1000 and increment
by 1,
they leave big holes in the sequence.
yes. I know. there is no other way.
if you want 1000 ids, but they don't have to be consequtive, you can
Thomas Guettler írta:
Hi,
how can you get N numbers (without holes) from a sequence?
Thomas
# create sequence tmp_seq cache 1000;
CREATE SEQUENCE
From the same client:
# select nextval('tmp_seq');
nextval
-
1
(1 sor)
# select nextval('tmp_seq');
nextval
-
On Tue, May 19, 2009 at 9:32 AM, Thomas Guettler h...@tbz-pariv.de wrote:
hubert depesz lubaczewski schrieb:
On Tue, May 19, 2009 at 01:45:17PM +0200, Thomas Guettler wrote:
how can you get N numbers (without holes) from a sequence?
alter sequence XXX increment by 1000;
select
Merlin Moncure wrote:
On Tue, May 19, 2009 at 9:32 AM, Thomas Guettler h...@tbz-pariv.de wrote:
hubert depesz lubaczewski schrieb:
On Tue, May 19, 2009 at 01:45:17PM +0200, Thomas Guettler wrote:
how can you get N numbers (without holes) from a sequence?
alter sequence XXX increment by 1000;
10 matches
Mail list logo