Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 83339475BD5 for ; Sat, 18 May 2002 07:03:24 -0400 (EDT) Received: from localhost (p50801895.dip.t-dialin.net [80.128.24.149]) by postgresql.org (Postfix) with ESMTP id BBB47475B6A for ; Sat, 18 May 2002 07:03:23 -0400 (EDT) Received: from eckhard by localhost with local (Exim 3.35 #1 (Debian)) id 1791zh-0006H8-00 for ; Sat, 18 May 2002 13:03:25 +0200 Date: Sat, 18 May 2002 13:03:25 +0200 From: Eckhard Hoeffner To: PHP PostgreSQL Subject: Re: using CURSOR with PHP Message-ID: <20020518110325.GA24074@fifoost.org> Mail-Followup-To: PHP PostgreSQL References: <20020518072624.GA16938@fifoost.org> <3CE62E92.4000002@catalyst.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <3CE62E92.4000002@catalyst.net.nz> User-Agent: Mutt/1.3.28i X-Archive-Number: 200205/58 X-Sequence-Number: 1190 * Andrew McMillan [18 05 02 12:36]: >Eckhard Hoeffner wrote: >>Does anyone has a solution to use the CURSOR function with PHP. The >>main problem - in my opinion - is, that the CURSOR must be closed >>and if the database is accessed from a web browser, this can not be >>ensured.=20 >> > >I don't use cursors in web applications myself, since PostgreSQL=20 >supports the excellent "SELECT ... LIMIT OFFSET " syntax in all=20 >of the cases where I might otherwise have done so. That's what I wanted to avoid as this results in a little more work.=20 >That's my experience to date, anyway - I'm prepared to find somewhere a=20 >cursor might be a requirement - I know that if you wanted to write=20 >cross-database portable code you would probably need to work with them. > >Regardless, unless you open your database connection as a persistent=20 >connection, the database connection will be closed when the script=20 >finishes, and that should clean up all that is necessary. I used persistent connections, however, I got lots of processes.=20 If the CURSOR is closed when the script has finished (pg_connect), it makes no sense (for me) using it, because I can not move within the results.=20 --=20 --//--\\-- Eckhard Hoeffner e-hoeffner@fifoost.org Tal 44=20 D-80331 M=FCnchen