X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 76A86DA05E for ; Mon, 3 Oct 2005 23:36:48 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33473-04 for ; Tue, 4 Oct 2005 02:36:43 +0000 (GMT) Received: from kyle.sinewave.com.au (kyle.sinewave.com.au [210.9.182.35]) by svr1.postgresql.org (Postfix) with ESMTP id 75D23DA052 for ; Mon, 3 Oct 2005 23:36:44 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by kyle.sinewave.com.au (Postfix) with ESMTP id 69E6113A29F for ; Tue, 4 Oct 2005 12:36:48 +1000 (EST) Received: from kyle.sinewave.com.au ([127.0.0.1]) by localhost (kyle [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08803-08 for ; Tue, 4 Oct 2005 12:36:47 +1000 (EST) Received: from wioota (mrscartman.hitwise.com [210.9.182.38]) by kyle.sinewave.com.au (Postfix) with ESMTP id 1DF9713A28D for ; Tue, 4 Oct 2005 12:36:47 +1000 (EST) Reply-To: From: "Daniel Walters" To: Subject: Re: Trouble with conections between php and postgre Date: Tue, 4 Oct 2005 12:37:53 +1000 Organization: Hitwise MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.6353 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 Thread-Index: AcXIgo76bJ+Bv5QMR/SqZzoSu77j8gABFRYw In-Reply-To: Message-Id: <20051004023647.1DF9713A28D@kyle.sinewave.com.au> X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at hitwise.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200510/9 X-Sequence-Number: 3277 Hi John, I have some clarification on your suggestion... This function is specifically for asynchronous queries though - if Luis = is not using asynchronous queries the mileage may vary. The other issue is = that even if the query can be cancelled how does Luis accurately determine = when to do this? To detect a closed or stopped/cancelled browser (see the notes in the = php manual under connection_status();) the script actually needs to poll the client (this can be done by flushing a single character in a loop down = to the browser - this is ugly for a lot of fairly obvious reasons). I think the key to issue is the session locking (as per my previous = post).=20 There is quite a history to this issue (browsing the archives of this = list and Usenet reveals this) and it is in fact the reason why I am on this = list. The issue has also been raised as bugs at http://bugs.php.net but have = been systematically closed without fixes since as early as 2001. Requests have been made for the addition of functions to pause a session (remove the file lock while a query is running because you know the = session wont be written to during this time) and then restart the session (once = the query has completed). This type of functionality can be somewhat achieved with session_write_close() except that this function unfortunately sends a = cookie header automatically and this causes issues for IE if done repeatedly. I have made some suggestions in my previous post (which is being = moderated currently) which may help but they are certainly not clean solutions. Hopefully someone will take notice (this time) of this thread and work = on making php deal with this better. Regards, Daniel Walters. -----Original Message----- From: pgsql-php-owner@postgresql.org = [mailto:pgsql-php-owner@postgresql.org] On Behalf Of John DeSoi Sent: Tuesday, October 04, 2005 11:17 AM To: luis linietsky Cc: pgsql-php@postgresql.org Subject: Re: [PHP] Trouble with conections between php and postgre On Oct 3, 2005, at 9:59 AM, luis linietsky wrote: > Hi !, first of all: sorry about my english, i'm not from us. > I 'm using latest versions of postgre 7.4 with php4 and apache2, on a=20 > debian system. I'm working with a really big database, so there are=20 > many querys that takes too much time to be executed (And there's=20 > nothig to do about it). These querys blocks the php page while's being = > loaded. The problem is that usually, one excepcts to stop those querys = > or even close the conection if the user stops the explorer or closes=20 > the window. However, this isn't hapening, the query keeps running in=20 > the database, using resources. > I already try uselessly ignore_user_abort(False), and I don't want to=20 > set a time limit. > =BFAny ideas? =BFAm I missing something ? There is a specific protocol for canceling a query in progress. Maybe = this PHP function will work for you: http://www.php.net/manual/en/function.pg-cancel-query.php John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq