Re: [GENERAL] Locking several tables within one transaction

2011-07-23 Thread Ilia Lilov
Thank you, Scott. I wondered about it, actually. I've found perfect (I believe) solution. It uses pg_advisory_lock() as I guessed before, but I thought wrong about it. For some reason I thought session is some kind of scope for advisory lock, so one program can't see locking made by another progra

Re: [GENERAL] Locking several tables within one transaction

2011-07-22 Thread Scott Marlowe
On Fri, Jul 22, 2011 at 9:45 AM, Ilia Lilov wrote: > There are two places from which my database can be accessed: > 1) PHP code, which only read data from db and sends it to users' browsers; > 2) C++ code, which writes data to db one time per 15 minutes (one huge > transaction which affects all th

[GENERAL] Locking several tables within one transaction

2011-07-22 Thread Ilia Lilov
There are two places from which my database can be accessed: 1) PHP code, which only read data from db and sends it to users' browsers; 2) C++ code, which writes data to db one time per 15 minutes (one huge transaction which affects all the tables in db); Both pieces of code use local socket to acc