Re: [BUGS] BUG #6258: Lock Sequence

2011-10-18 Thread Laerson keler
good idea. I will try. Thank you. []Laerson Keler laerson.ke...@lkmc.com.br Cel: 11 9914-4030 Res: 11 3404-4632 2011/10/17 Jaime Casanova > On Mon, Oct 17, 2011 at 2:43 PM, Tom Lane wrote: > > > > There really is not any way to generate guaranteed-hole-free sequences > > using sequence object

Re: [BUGS] BUG #6258: Lock Sequence

2011-10-18 Thread Laerson keler
I changed the logic of the trigger, I'm using before and taking the next_val (). Thank you. []Laerson Keler laerson.ke...@lkmc.com.br Cel: 11 9914-4030 Res: 11 3404-4632 2011/10/17 Tom Lane > Laerson keler writes: > > 2011/10/17 Tom Lane > >> "Laerson Keler" writes: > >> Why did you do that

Re: [BUGS] BUG #6258: Lock Sequence

2011-10-17 Thread Jaime Casanova
On Mon, Oct 17, 2011 at 2:43 PM, Tom Lane wrote: > > There really is not any way to generate guaranteed-hole-free sequences > using sequence objects.  If you have to have that, I'd suggest locking > the table against other writes and then fetching MAX(id) + 1.  It's not > very fast, and it's not a

Re: [BUGS] BUG #6258: Lock Sequence

2011-10-17 Thread Tom Lane
Laerson keler writes: > 2011/10/17 Tom Lane >> "Laerson Keler" writes: >> Why did you do that, that is what were you trying to accomplish? It >> never did block nextval() on the sequence, for example. > Tom Lane, good afternoon, I block the sequence not to miss the sequel, for > it not to be s

Re: [BUGS] BUG #6258: Lock Sequence

2011-10-17 Thread Euler Taveira de Oliveira
On 17-10-2011 12:52, Tom Lane wrote: "Laerson Keler" writes: Dear Srs, good morning, I did the automatic update postgresql 8.4.9 and a function stopped working, I used the option select for update in a sequence and is now giving the following error "can not lock rows in sequence ...", how can I

Re: [BUGS] BUG #6258: Lock Sequence

2011-10-17 Thread Laerson keler
Tom Lane, good afternoon, I block the sequence not to miss the sequel, for it not to be skipped if the insert to fail. My logic involves two triggers, one before and one after. I give the first one in last_value select for update in the sequence and insert after I run a select next_val ('sequence')

Re: [BUGS] BUG #6258: Lock Sequence

2011-10-17 Thread Tom Lane
"Laerson Keler" writes: > Dear Srs, good morning, I did the automatic update postgresql 8.4.9 and > a function stopped working, I used the option select for update > in a sequence and is now giving the following error "can not lock rows in > sequence ...", how can I enable the blocking of the sequ

[BUGS] BUG #6258: Lock Sequence

2011-10-17 Thread Laerson Keler
The following bug has been logged online: Bug reference: 6258 Logged by: Laerson Keler Email address: laerson.ke...@lkmc.com.br PostgreSQL version: 8.4.9 Operating system: Ubuntu 10.04 - Kernel 2.6.32-34 Description:Lock Sequence Details: Dear Srs, good morning, I d