Re: [ADMIN] select for update

2011-04-23 Thread Craig James
On 4/22/11 8:17 PM, Tom Lane wrote: Craig James writes: On 4/22/11 1:58 PM, Tom Lane wrote: Craig James writes: select objectid from archive where db_id is null limit 1 for update The interaction between LIMIT and FOR UPDATE changed in 9.0 ... what PG version are you using? 8.4.4 Well, n

Re: [ADMIN] select for update

2011-04-22 Thread Tom Lane
Craig James writes: > On 4/22/11 1:58 PM, Tom Lane wrote: >> Craig James writes: >>> select objectid from archive where db_id is null limit 1 for update >> The interaction between LIMIT and FOR UPDATE changed in 9.0 ... what >> PG version are you using? > 8.4.4 Well, note what it says in the 8

Re: [ADMIN] select for update

2011-04-22 Thread Craig James
On 4/22/11 1:58 PM, Tom Lane wrote: Craig James writes: select objectid from archive where db_id is null limit 1 for update The interaction between LIMIT and FOR UPDATE changed in 9.0 ... what PG version are you using? 8.4.4 thanks, Craig regards, tom lane --

Re: [ADMIN] select for update

2011-04-22 Thread Tom Lane
Craig James writes: >select objectid from archive where db_id is null limit 1 for update The interaction between LIMIT and FOR UPDATE changed in 9.0 ... what PG version are you using? regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org

Re: [ADMIN] select for update

2011-04-22 Thread Kevin Grittner
Craig James wrote: > The sequence of operations goes like this (pseudo-code): > The problem is that very occasionally the same ID will be issued > twice. I don't see how this can be. Doesn't the "for update" > guarantee that no other process can claim that same row? I don't see a flaw in t

[ADMIN] select for update

2011-04-22 Thread Craig James
I thought I understood "select ... for update," but maybe not. We have a number of separate databases and a unique integer identifier that's supposed to be global across all databases. A single "archive" database is used to issue the next available ID when a process wants to create a new objec

Re: [ADMIN] SELECT FOR UPDATE NOWAIT

2006-09-28 Thread Jim C. Nasby
On Thu, Sep 28, 2006 at 03:26:36PM +, Mathias Laurent wrote: > If I do : > Session 1: > decibel=# begin; Does decibel have some meaning in some language other than english? > BEGIN > decibel=# select * from i where i=1 for update nowait; > i > --- > 1 > (1 row) > > decibel=# begin; > BEGIN >

[ADMIN] SELECT FOR UPDATE NOWAIT

2006-09-28 Thread Mathias Laurent
If I do : Session 1: decibel=# begin; BEGIN decibel=# select * from i where i=1 for update nowait; i --- 1 (1 row) decibel=# begin; BEGIN decibel=# select * from i where i=2 for update nowait; i --- 2 (1 row) Session 2 : decibel=# select * from i where i=1 for update nowait; ERROR: could not o