connection problem

From: Abdul-wahid Paterson <aw(at)lintrix(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: connection problem
Date: 2003-05-12 16:48:24
Message-ID: 1052758103.25773.1225.camel@yusuf.lintrix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a bit of code that is causing me problems. I am using the Perl Pg
module for connecting to Postgres because it is close to libpq.

I have the following lines (simplified from my original program)

# Test database connection
if($conn->status != PGRES_CONNECTION_OK) {
die "DB Error: ".$conn->errorMessage."\n";
}
else {
print "********Connection ok********\n";
}
# vacuum
my $sql = "VACUUM verbose";
my $result = $conn->exec($sql);
if($result->resultStatus != PGRES_COMMAND_OK) {
die "SQL: $sql\nDB ERROR: ".$conn->errorMessage."\n";
}

The output I get from this part of the script is:

********Connection ok********
SQL: VACUUM verbose
DB ERROR: pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.

The strange thing is, other scripts on the server are working fine and
the database server hasn't been causing any other problems. The server
with the problem is Postgres 7.1.3 (bit old I know but client has not
got around to upgrading).

On my development machine I am running Postgres 7.3.2 and the same piece
of code works fine and vacuums the database as expected.

Any ideas what would cause the backend to reset and produce a pqReadData
error? Could the $conn->status give incorrect information?

Regards,

--
Abdul-Wahid Paterson

Lintrix Networking & Communications ltd.
Web: http://www.lintrix.net/
Tel: +44 7801 070621
Email/Jabber: aw(at)lintrix(dot)net
--------------------------------------------------------------------
Web-Hosting | Development | Security | Consultancy | Domains
--------------------------------------------------------------------

Browse pgsql-general by date

  From Date Subject
Next Message Adam Sherman 2003-05-12 17:01:40 Re: Performance Problem
Previous Message gnotari 2003-05-12 16:38:53 Re: Zope