table locking

Поиск
Список
Период
Сортировка
От Shane Wright
Тема table locking
Дата
Msg-id 200202181439.g1IEdDL16952@fullerruss.dsvr.co.uk
обсуждение исходный текст
Ответы Re: table locking  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-sql
Hi

I'm having trouble getting my head round postgres's locking.  I've read 
through all the docs but cant seem to find the right thingthat does what I 
want...


Basically, there are a few tables in my system where a SELECT is done prior 
to an INSERT to avoid duplicating certain data and so forth.

So, I want to lock the table for the transaction that does the stuff above so 
no more than one can run at a time (essentially making it SERIALIZABLE).  
But, I dont want to block other readers from SELECTing from the table at the 
same time...

This is the classic multiple readers, single writer problem yes?  I'm sure 
its doable, but I cant work out which locking / transaction isolation levels 
to use.

Thanks

--
Shane






В списке pgsql-sql по дате отправления:

Предыдущее
От: "Nick Fankhauser"
Дата:
Сообщение: Re: Need to change the size of a field
Следующее
От: tconti@hotmail.com (T Conti)
Дата:
Сообщение: Join Statements