Re: Connection gets into state where all queries fail

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Connection gets into state where all queries fail
Date: 2004-06-22 22:09:10
Message-ID: 20040622220910.GB27296@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Responses

Browse pgsql-general by date

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