BUG #13598: Hang forever, but must rollback (deadlock) - Mailing list pgsql-bugs

From immortaldragonm@gmail.com
Subject BUG #13598: Hang forever, but must rollback (deadlock)
Date
Msg-id 20150831080351.2088.33853@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #13598: Hang forever, but must rollback (deadlock)  (Andres Freund <andres@anarazel.de>)
List pgsql-bugs
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.

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: PQexec() hangs on OOM
Next
From: Andres Freund
Date:
Subject: Re: BUG #13598: Hang forever, but must rollback (deadlock)