The following bug has been logged on the website:
Bug reference: 13598
Logged by: ImmortalDragon
Email address: immortaldragonm@gmail.com
PostgreSQL version: 9.4.4
Operating system: windows
Description:
table:
CREATE TABLE t1(id integer primary key);
libpq code:
c1 = PQconnectdb(conninfo);
c2 = PQconnectdb(conninfo);
res1 = PQexec(c1, "BEGIN");
PQclear(res1);
res1 = PQexec(c1, "INSERT INTO t1 (id) VALUES (104)");
PQclear(res1);
res2 = PQexec(c2, "BEGIN");
PQclear(res2);
res2 = PQexec(c2, "INSERT INTO t1 (id) VALUES (104)"); //hang here
PQclear(res2);
res2 = PQexec(c2, "END");
PQclear(res2);
res1 = PQexec(c1, "END");
PQclear(res1);
I use different connection in one thread (like different programs, as i
undestand).
I think, that postgres must detect deadlock and rollback one of transaction
with error. But it hang forever. Why? i think it's bug.
deadlock_timeout - default (1s)
i check other version of postgres, same result.