Re: [GENERAL] allocate chunk of sequence

2007-06-20 Thread Scott Marlowe
PFC wrote: The chunk to be allocated is not the same size, so to set the increment value will not help. I'm sometimes not that subtle, so I'd just use a BIGINT sequence. Think about the largest chunk you'll ever get (probably less than 2^30 rows, yes ?), set this sequence increment to t

Re: [GENERAL] allocate chunk of sequence

2007-06-16 Thread PFC
The chunk to be allocated is not the same size, so to set the increment value will not help. I'm sometimes not that subtle, so I'd just use a BIGINT sequence. Think about the largest chunk you'll ever get (probably less than 2^30 rows, yes ?), set this sequence increment to this very hig

Re: [GENERAL] allocate chunk of sequence

2007-06-16 Thread Gary Fu
Scott Marlowe wrote: Gary Fu wrote: hello, I try to allocate a chunk of ids from a sequence with the following proc. However, if I don't use the 'lock lock_table', the proc may not work when it runs at the same time by different psql sessions. Is there a better way without using the 'lock

Re: [GENERAL] allocate chunk of sequence

2007-06-15 Thread Scott Marlowe
Gary Fu wrote: hello, I try to allocate a chunk of ids from a sequence with the following proc. However, if I don't use the 'lock lock_table', the proc may not work when it runs at the same time by different psql sessions. Is there a better way without using the 'lock lock_table' ? a

[GENERAL] allocate chunk of sequence

2007-06-14 Thread Gary Fu
hello, I try to allocate a chunk of ids from a sequence with the following proc. However, if I don't use the 'lock lock_table', the proc may not work when it runs at the same time by different psql sessions. Is there a better way without using the 'lock lock_table' ? Thanks, Gary create o