Re: [HACKERS] [bug fix] Savepoint-related statements terminates connection - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [HACKERS] [bug fix] Savepoint-related statements terminates connection
Date
Msg-id CAB7nPqQ_upowcgA8teBh3A__+57dDZ+Z+8gmN2Z1XDFLxFPFdQ@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] [bug fix] Savepoint-related statements terminatesconnection  ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>)
List pgsql-hackers
On Fri, Mar 31, 2017 at 9:58 PM, Ashutosh Bapat
<ashutosh.bapat@enterprisedb.com> wrote:
> Then the question is why not to allow savepoints as well? For that we
> have to fix transaction block state machine.

I agree with this argument. I have been looking at the patch, and what
it does is definitely incorrect. Any query string including multiple
queries sent to the server is executed as a single transaction. So,
while the current behavior of the server is definitely incorrect for
savepoints in this case, the proposed patch does not fix anything but
actually makes things worse. I think that instead of failing,
savepoints should be able to work properly. As you say cursors are
handled correctly, savepoints should fall under the same rules.
-- 
Michael



pgsql-hackers by date:

Previous
From: "Tsunakawa, Takayuki"
Date:
Subject: Re: [HACKERS] [bug fix] PG10: libpq doesn't connect to alternativehosts when some errors occur
Next
From: "Tsunakawa, Takayuki"
Date:
Subject: Re: [HACKERS] [bug fix] Savepoint-related statements terminatesconnection