X-Original-To: pgsql-general@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8E15A4758E1 for ; Tue, 4 Feb 2003 06:00:24 -0500 (EST) Received: from edison.ioppublishing.com (edison.ioppublishing.com [193.128.223.242]) by postgresql.org (Postfix) with SMTP id 506FD4758DC for ; Tue, 4 Feb 2003 06:00:23 -0500 (EST) Received: (qmail 1836 invoked from network); 4 Feb 2003 11:00:25 -0000 Received: from unknown (HELO localhost.localdomain) (127.0.0.1) by localhost with SMTP; 4 Feb 2003 11:00:25 -0000 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "Peter Haworth" To: "Nigel J. Andrews" , greg@turnstep.com Cc: pgsql-general@postgresql.org Subject: Re: DBI driver and transactions Date: Tue, 4 Feb 2003 11:00:24 +0000 Message-Id: X-Mailer: PGM v0.17 References: X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/201 X-Sequence-Number: 36955 On Mon, 3 Feb 2003 14:49:39 +0000 (GMT), Nigel J. Andrews wrote: > I presume that the issue here is that in the 1 or 0 rows returned case > where 1 row indicates I have a problem then I am not fetching from or > finishing that statement. Although, in the debugger I've seen the Active > flag still set after doing a single fetch on a 1 row resultset. The problem is that the statement doesn't get marked inactive until you have fetched the row after the last one: # There are some rows to fetch here $sth1->execute; # Active ... $sth1->fetch; # Last row returned, still active $sth1->fetch; # undef returned, now it's inactive # No rows to fetch in this case $sth0->execute; # Active $sth0->fetch; # undef returned, now it's inactive As you can see, this behaviour is necessary in order that empty result sets can be recognised. Otherwise you'd be fetching on an inactive handle. -- Peter Haworth pmh@edison.ioppublishing.com Hi, this is Ken. What's the root password?