Re: Broken pipe - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Broken pipe
Date
Msg-id 20051002124950.GE30492@svana.org
Whole thread Raw
In response to Broken pipe  (Ben-Nes Yonatan <da@canaan.co.il>)
Responses Re: Broken pipe  (Ben-Nes Yonatan <da@canaan.co.il>)
List pgsql-general
On Sun, Oct 02, 2005 at 12:07:18PM +0200, Ben-Nes Yonatan wrote:
> I wrote a php script which is running very long queries (hours) on a
> database.
> I seem to have a problem to run the code when there are single queries
> which take long times (like 5 hours for an update query), from the log
> of the database I received the following code:

My experience with long running backend queries is that IE gives up
after a while but Netscape hangs on a lot longer. I don't know if this
is still the case. It was a while while I worked out why it worked for
me but not my boss...

You need to work who is giving up, the client which causes PHP to give
up, or if PHP itself is giving up. PostgreSQL doesn't care overly much,
as long as you complete the transaction.

My suggestion would be to spawn the update into a seperate process and
send a "Processing, please wait" to the client. When the stuff is done,
set a flag and indicate to the client that processing is complete.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: varchar to text
Next
From: Andreas Kretschmer
Date:
Subject: Re: Multiple database queries