Thread: Postgresql backend error

Postgresql backend error

From
Nigel Gilbert
Date:
I have PHP 4.06,  PostgreSQL 7.1.2 on sparc-sun-solaris2.7, compiled
by GCC 2.8.1, and Apache on a Solaris server.  Most of the time all
works as expected.  Occasionally I get an database error:

Database error
There was a database error when accessing Database zwg:
pqReadData() -- backend closed the channel unexpectedly. This probably
means the backend terminated abnormally before or while processing the
request.
(while evaluating: SELECT serializedobject FROM objects WHERE name='Zurich')

[This error page is generated by my application; it displays the
error reported by PostgreSQL and the SQL that caused the error].
serializedobject is a VARCHAR(10000).  The table consists of just one
row at the moment.  The query should always succeed (since that row
has its name field equal to Zurich).

The error is not caused by my SQL syntax, since this same code
executes without a problem at other times.   I don't know why I
sometimes get this error, while most of the time it works fine.

How do I start tracking down the cause?  What circumstances should I
be looking at to see what triggers it?

Nigel Gilbert



Re: Postgresql backend error

From
Tom Lane
Date:
Nigel Gilbert <n.gilbert@soc.surrey.ac.uk> writes:
> How do I start tracking down the cause?

Look in the postmaster's stderr log to see what gets logged.  (If you're
not keeping the log output, now's a good time to start.)  Look to see if
a core file gets dropped in the database subdirectory
($PGDATA/base/whatever/); if so, try to extract a stack trace from it
with gdb.

            regards, tom lane