On Wed, May 20, 2009 at 3:00 AM, Thomas Guettler 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 way
m
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
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_is
Merlin Moncure wrote:
> On Tue, May 19, 2009 at 9:32 AM, Thomas Guettler 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;
>>
On Tue, May 19, 2009 at 9:32 AM, Thomas Guettler 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 nextval('XXX');
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 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
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 /
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 next
On Tue, May 19, 2009 at 12:45 PM, Thomas Guettler 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 (pgsql-general@postgresql.org)
To
Hi,
how can you get N numbers (without holes) from a sequence?
Thomas
--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.
11 matches
Mail list logo