Re: Sudden semi-deterministic disconnection between queries

From: Richard Huxton <dev(at)archonet(dot)com>
To: Peter Schuller <peter(dot)schuller(at)infidyne(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Sudden semi-deterministic disconnection between queries
Date: 2004-03-10 10:15:03
Message-ID: 200403101015.03585.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday 10 March 2004 07:34, Peter Schuller wrote:
> Hello,
>
> I have a difficult-to-debug problem. I will try to keep this as brief as
> possible without leaving things out. In a certain situation my application
> fails with:
>
> org.postgresql.util.PSQLException: Connection is closed. Operation is
> not permitted.
>
> After some debugging I realized that this would happen on the first query,
> regardless of what it is, *after* a specific previous query. In other
> words:
>
> query1
> query2
> ...
> queryN <- seems to cause the failure
> queryN+1 <- failure
>
> queryN *seemingly* completes successfully without any error messsage, but
> then I get the above error when executing queryN+1.

When I get this it's because of bad quoting, which means it never sees queryN
finished until queryN+1 happens. Missing semicolon/closing bracket etc.

> Does anyone have any suggestions at all of what might cause this, or how I
> might debug further? Can I make postgresql do extremely verbose logging
> somehow? For example, if the postmaster is intentionally closing the
> connection it would be interesting to know why.

Assuming you're logging anything, start with LOG_STATEMENT and perhaps follow
up with SERVER_MIN_MESSAGES. Note that you can do this with SQL
SET LOG_STATEMENT=on;

There are details on log settings in the runtime configuration section of the
manuals. You can log huge amounts of info if you like.
--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-03-10 10:28:33 Re: Sudden semi-deterministic disconnection between queries
Previous Message Richard Huxton 2004-03-10 09:54:30 Re: load testing