Re: Accessing a database via AJAX scripts

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Glen Eustace <geustace(at)godzone(dot)net(dot)nz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Accessing a database via AJAX scripts
Date: 2010-08-08 19:24:12
Message-ID: 27283.1281295452@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Glen Eustace <geustace(at)godzone(dot)net(dot)nz> writes:
> Unfortunately your comments don't shed any light on the error I am getting;
> "could not receive data from server: Bad file descriptor".

> This suggests to me that I might have lost the connection in my forked
> perl process to the back-end. Can you confirm or deny ?

Not on that much evidence; but trying to pass a libpq connection across
a fork is usually risky. The trouble is that both parent and child
processes now hold copies of the open socket connection, but only one of
them can safely work with it. It could be that you've closed the libpq
connection in one process and that killed its usability in the other.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2010-08-08 19:33:40 Re: Using AND in query
Previous Message Glen Eustace 2010-08-08 19:06:39 Re: Accessing a database via AJAX scripts