3

I have very strange problem with my application, upon occasions I get following error when connecting to postgres. This happens without any pattern, often happens when I run some extensive selenium tests.

Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.

Postgres logs shows no abnormalities, also other applications that run on same postgres instance have no problems at all.

My Postgres is 8.2.9, running on windows 2008 server

Any hints ?

1
  • 1
    Please tag your questions properly. Commented Mar 12, 2011 at 15:41

3 Answers 3

1

"server closed the connection unexpectedly" most of the time means the backend crashed. If that's the case there should be some lines about it in the server log.

And by the way the latest version in the 8.2 branch is 8.2.12. Upgrade, test, report.

Sign up to request clarification or add additional context in comments.

1 Comment

Server's not crashing. It runs another applications and they don't report crashes, logs are also clean. I'm absolutely clueless.
0

A random guess. Do you use persistent connections?

3 Comments

Problem seems to be random ;), I use 'pg_connect', not pg_pconnect so I belive connection is not persistent
What's the connection timeout set to? Are your requests longer-running operations than the apps that have no problems?
My requests are no different to other application's request, standard web page requests. As for connection timeout I dont set it explicitly. I looked in postgres conf file and see no timeout settings there, not sure where to look for it
0

You're only showing the client error. Since it means that something happened on the backend, you will need to look in your server logs for information about what actually happened. (The postgres logs and/or the eventlog - check both)

A typical reason for these things to happen is if you are running some antivirus software on the server. If you do, try uninstalling it (not just disabling it) and see if the problem goes away.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.