Re: [GENERAL] Counterintuitive locking behavior

2013-01-06 Thread Thomas Kellerer
Chris Travers wrote on 06.01.2013 03:18: i.e. where on UPDATE foo, all rows selected from foo during the update are locked unless the subselect specifically states otherwise. That would strike *me* as wrong. The UPDATE should only lock the rows that were actually updated, not those that were

[GENERAL] Counterintuitive locking behavior

2013-01-05 Thread Chris Travers
Hi everyone; I recently discovered that subselects in update statements don't assume that the select is for update of the updating table. For example, if I do this: CREATE TABLE foo ( test int primary key, ); INSERT INTO foo VALUES (1); then in one session: BEGIN; UPDATE foo SET test = 2

Re: [GENERAL] Counterintuitive locking behavior

2013-01-05 Thread Amit kapila
On Sunday, January 06, 2013 7:48 AM Chris Travers wrote: I recently discovered that subselects in update statements don't assume that the select is for update of the updating table. For example, if I do this: CREATE TABLE foo ( test int primary key, ); INSERT INTO foo VALUES (1);

Re: [GENERAL] Counterintuitive locking behavior

2013-01-05 Thread Amit kapila
On Sunday, January 06, 2013 11:10 AM Amit kapila wrote: On Sunday, January 06, 2013 7:48 AM Chris Travers wrote: Is there a reason why we don't do locking this way? (i.e. where on UPDATE foo, all rows selected from foo during the update are locked unless the subselect specifically states

Re: [GENERAL] Counterintuitive locking behavior

2013-01-05 Thread Boszormenyi Zoltan
2013-01-06 03:18 keltezéssel, Chris Travers írta: Hi everyone; I recently discovered that subselects in update statements don't assume that the select is for update of the updating table. For example, if I do this: CREATE TABLE foo ( test int primary key, ); INSERT INTO foo VALUES (1);