Re: [GENERAL] table locking and SELECT FOR UPDATE

2005-07-11 Thread Joseph Shraibman
The situation I have is that there are some records in a table that need to be updated, some of which don't exist and need to be created. So I start a transaction and do a SELECT FOR UPDATE to lock the existing rows and LOCK TABLE IN SHARE MODE to keep inserts from happening. The problem is t

Re: [GENERAL] table locking and SELECT FOR UPDATE

2005-07-11 Thread Tom Lane
Joseph Shraibman writes: > How come when a share lock is held and update can't be done on the > table, but a SELECT FOR UPDATE can be done? I can't SELECT FOR UPDATE > the same row in two transactions, but I can SELECT FOR UPDATE a row that > I will won't be able to update because the other ta

[GENERAL] table locking and SELECT FOR UPDATE

2005-07-11 Thread Joseph Shraibman
How come when a share lock is held and update can't be done on the table, but a SELECT FOR UPDATE can be done? I can't SELECT FOR UPDATE the same row in two transactions, but I can SELECT FOR UPDATE a row that I will won't be able to update because the other table is held in a SHARE lock. -