Skip site navigation (1) Skip section navigation (2)

Re: psql or pgbouncer bug?

From: Tom Molesworth <tom(at)audioboundary(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: psql or pgbouncer bug?
Date: 2010-05-22 14:24:49
Message-ID: 4BF7E931.40008@audioboundary.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Hi Jakub,

On 21/05/10 16:19, Jakub Ouhrabka wrote:
> can anyone tell me how this could happen, please?
>
> database=# begin; update table set col = 100;
> server closed the connection unexpectedly
>        This probably means the server terminated abnormally
>        before or while processing the request.
> The connection to the server was lost. Attempting reset: Succeeded.
> UPDATE 153
> database=# ROLLBACK ;
> WARNING:  there is no transaction in progress
> ROLLBACK

I don't know anything about psql internals, but at a guess the sequence 
is this:
* 'begin' is sent to server
* Connection is dropped
* Connection is reset, but 'begin' is not resent
* Next statement (the update) is sent to the server, executes immediately
* Rollback gives error since there was no corresponding begin

Seems to be trivially easy to reproduce by connecting via psql, then 
killing that connection before issuing the 'begin; update' sequence 
(against postgres directly, no pgbouncer needed). If anything, it's an 
issue with psql settings? Maybe it should stop on connection drop rather 
than attempting reconnect and continuing with further statements.

Tom


In response to

Responses

pgsql-bugs by date

Next:From: Craig RingerDate: 2010-05-22 14:50:03
Subject: Re: BUG #5468: Pg doesn't send accepted root CA list to client during SSL client cert request
Previous:From: Craig RingerDate: 2010-05-22 04:01:23
Subject: Re: BUG #5468: Pg doesn't send accepted root CA list to client during SSL client cert request

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group