Re: [SQL] SELECT FOR UPDATE locks whole table

2002-12-07 Thread D'Arcy J.M. Cain
On December 6, 2002 02:10 pm, Bruce Momjian wrote: > It should lock only the rows you retrieved, but I have no idea how FOR > UPDATE and INTO TEMP behave. My guess is that it should work fine, but > I have never seen those two used together before. Turns out that it wasn't the SELECT ... FOR UPDA

Re: [SQL] SELECT FOR UPDATE locks whole table

2002-12-06 Thread Tom Lane
"D'Arcy J.M. Cain" <[EMAIL PROTECTED]> writes: > We have the following query: > SELECT certificate_id > INTO TEMP TABLE x_certs > FROM certificate > WHERE cert_status = 0 AND > certificate_id BETWEEN AND AND > client_id IN (1, 2, 3) > ORDER BY certificate_i

Re: [SQL] SELECT FOR UPDATE locks whole table

2002-12-06 Thread Bruce Momjian
It should lock only the rows you retrieved, but I have no idea how FOR UPDATE and INTO TEMP behave. My guess is that it should work fine, but I have never seen those two used together before. --- D'Arcy J.M. Cain wrote: > W

[SQL] SELECT FOR UPDATE locks whole table

2002-12-06 Thread D'Arcy J.M. Cain
We have the following query: SELECT certificate_id INTO TEMP TABLE x_certs FROM certificate WHERE cert_status = 0 AND certificate_id BETWEEN AND AND client_id IN (1, 2, 3) ORDER BY certificate_id FOR UPDATE; Is there any reason that this query should