Re: Connection gets into state where all queries fail - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Connection gets into state where all queries fail
Date
Msg-id 20040622220910.GB27296@svana.org
Whole thread Raw
In response to Connection gets into state where all queries fail  (Scott Ribe <scott_ribe@killerbytes.com>)
Responses Re: Connection gets into state where all queries fail
List pgsql-general
On Tue, Jun 22, 2004 at 03:06:39PM -0600, Scott Ribe wrote:
> OK, I'm using a pool of worker threads that each have a connection (from my
> own software, no PHP or anything like that involved), and a connection is in
> a state where all queries fail. Looking back through the log I find the
> first entry where this connection has an error (there are successful queries
> on it prior, so it's not the first query):
>

Your problem is that you have an error within a transaction and as the
error message states:

> 2004-06-21 14:51:58 [5589]   ERROR:  current transaction is aborted, queries
> ignored until end of transaction block

All your queries will be ignored until you complete the transaction,
either with a commit or a rollback. I find the message very clear, how
do you think it could be reworded to be more clear?

> - Is there something I need to do after an error like this, in order to get
> the connection back to a usable state?

COMMIT or ROLLBACK

> - Is this a bug?

In your program, yes. Although I find it interesting that your commit
is ignored after the error. Just send it as a seperate query.

> - Is there anything I can do to provide more information? I still have the
> server running right now, but I'm going to have to reboot soon because this
> is causing problems.

Just add a transaction commit or rollback after the error.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Rick Gigger
Date:
Subject: Re: [ANNOUNCE] == PostgreSQL Weekly News - June 22nd 2004
Next
From: Martijn van Oosterhout
Date:
Subject: Re: flock user defined function