Deadlock Situation with Postmaster, Libpq and pgtclsh
Deadlock Situation with Postmaster, Libpq and pgtclsh
От:
Mark Grimsey <mgrimsey@compuserve.com>
Дата:
Help I have a simple database table that has 10 tuples of 3 fields. It is accessed by a number of C programs using libpq to check if certain fields contain the value 1 or 0. A pgtclsh program is the user interface for setting the value to either 1 or 0. The problem I have is that when a user tries to change the value from pgtclsh, the system locks up. The pgtclsh program connects to the database and then calls pg_exec with an UPDATE command to change the value. 9 times out of 10 it will work but every so often it locks all Postgres connections to the database and hangs, never returning to the next line in the pgtclsh program. This always happens when a C program using libpq is accessing the same table for a read. Am I doing something fundamentally wrong or is there a problem with pgtclsh accessing a table whilst others are too ? Thanks Mark Grimsey mgrimsey@compuserve.com