Search Postgresql Archives

Re: Understanding of LOCK and pg_sleep interaction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"David Johnston" <polobo@xxxxxxxxx> writes:
> In trying to setup a test for a LOCK 'table' algorithm I attempt to execute
> two transactions where the first one issues a pg_sleep(10) while 'table' is
> locked and the second one attempts LOCK 'table' during the time when the
> pg_sleep is executing.  When pg_sleep() returns in the first transaction the
> subsequent statement is not executed.  Meanwhile, the second transaction
> continues to wait for the lock.  Thus, a deadlock has occurred.  I am doing
> my testing within PostGreSQL Maestro running as a "script" and issuing BEGIN
> and COMMIT statements around the desired transaction commands.

I don't know anything about PostGreSQL Maestro, but what it sounds like
from this description is that it's not committing the transaction right
away when the script finishes.  You might try turning on log_statement
on the server side so you can see exactly what commands are being sent
and when.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux