Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 754471337BB0 for ; Tue, 5 Oct 2010 14:51:28 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 85552-04-3 for ; Tue, 5 Oct 2010 17:51:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm19-vm0.bullet.mail.ne1.yahoo.com (nm19-vm0.bullet.mail.ne1.yahoo.com [98.138.91.59]) by mail.postgresql.org (Postfix) with SMTP id 8DD261337BCB for ; Tue, 5 Oct 2010 14:51:20 -0300 (ADT) Received: from [98.138.90.50] by nm19.bullet.mail.ne1.yahoo.com with NNFMP; 05 Oct 2010 17:51:19 -0000 Received: from [98.138.87.2] by tm3.bullet.mail.ne1.yahoo.com with NNFMP; 05 Oct 2010 17:51:19 -0000 Received: from [127.0.0.1] by omp1002.mail.ne1.yahoo.com with NNFMP; 05 Oct 2010 17:51:18 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 902918.17481.bm@omp1002.mail.ne1.yahoo.com Received: (qmail 64744 invoked by uid 60001); 5 Oct 2010 17:51:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1286301078; bh=iEeJqVwzffncSZ4QDBk1iMgPM3cZgcYv6kBaw/scUlM=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=0PwMTfwDJOaSp0rh4ME+j1qNoqljTIk2eCP1EO9SdHn7awqj5fK5K+c2ErHr3dwQm9AXeg+i/P7fl6l9byeeBIhSSg+YDoXDYOu12v4XfOKWNMhoU96LhNIlDwgyBlsBcNovO60ufctiXyy5AOUYqX09j0rrGVFmkFa0KWEo+MY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=4+MuQBzPFSngptBpJIWpd2f4+fz76X99aAUYbMg2412fKmxO4eWXM7EmJuQiCMRaNvBpNocATwraKJ2sD69PaLNBgFjlovPmrN8JRQ1Fa6OfF1o4CcMSCnJogjrAi7oLipeinn03xu+ycwx3gJ/vf07F244BWtlc4JQ3//AL29o=; Message-ID: <765296.62990.qm@web120013.mail.ne1.yahoo.com> X-YMail-OSG: Xsz1GAYVM1ncxjSxvwgiS6cvz55JRhXBJ24da5n42A_uNID k58GyoA3JAc7kvW6I44gTzhI_C2MPwmiHANSM2ZkgobHMAerc8ZY5Ra5OZyX ZrsVyaj1adRKFTeg5gR93RSwGp1O0yUWTANv1sc0anY14hukDhFVPk7uQ1dO KNiWhLUJPWDhKpSfQxtvVr6Heb7agw0Njj8tbzHvY2EAI5NRwwLX2FjvJiSA k81bj8vZ2iXX9iGxhfw-- Received: from [129.44.63.215] by web120013.mail.ne1.yahoo.com via HTTP; Tue, 05 Oct 2010 10:51:18 PDT X-Mailer: YahooMailRC/497 YahooMailWebService/0.8.106.282862 References: <812668.19871.qm@web120007.mail.ne1.yahoo.com> <4CA9FEBE02000025000364B4@gw.wicourts.gov> Date: Tue, 5 Oct 2010 10:51:18 -0700 (PDT) From: A J Subject: Re: ECPG: AUTOCOMMIT and CURSORs To: Kevin Grittner , pgsql-admin@postgresql.org In-Reply-To: <4CA9FEBE02000025000364B4@gw.wicourts.gov> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-143369836-1286301078=:62990" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/42 X-Sequence-Number: 35783 --0-143369836-1286301078=:62990 Content-Type: text/plain; charset=us-ascii That would explain it. I was neither in a transaction nor did any explicit HOLD. Thanks Kevin. ________________________________ From: Kevin Grittner To: pgsql-admin@postgresql.org; A J Sent: Mon, October 4, 2010 5:20:14 PM Subject: Re: [ADMIN] ECPG: AUTOCOMMIT and CURSORs A J wrote: > I am seeing some funny behavior on using both: > EXEC SQL SET AUTOCOMMIT TO ON; > and > CURSORS (EXEC SQL DECLARE ............., EXEC SQL FETCH NEXT FROM > .............) > > On autocommit on (either through above method or precompiling with > -t option), > the cursor does not return any rows. On disabling autocommit, I > get the required number of rows from the cursor. > > Any idea what could be going on ? Are you inside of a transaction? How does the WITH or WITHOUT HOLD function in ECPG? From the manual: http://www.postgresql.org/docs/current/interactive/sql-declare.html "WITHOUT HOLD specifies that the cursor cannot be used outside of the transaction that created it. If neither WITHOUT HOLD nor WITH HOLD is specified, WITHOUT HOLD is the default." -Kevin --0-143369836-1286301078=:62990 Content-Type: text/html; charset=us-ascii
That would explain it. I was neither in a transaction nor did any explicit HOLD. Thanks Kevin.


From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: pgsql-admin@postgresql.org; A J <s5aly@yahoo.com>
Sent: Mon, October 4, 2010 5:20:14 PM
Subject: Re: [ADMIN] ECPG: AUTOCOMMIT and CURSORs

A J <s5aly@yahoo.com> wrote:

> I am seeing some funny behavior on using both:
> EXEC SQL SET AUTOCOMMIT TO ON;
> and
> CURSORS (EXEC SQL DECLARE ............., EXEC SQL FETCH NEXT FROM
> .............)
>
> On autocommit on (either through above method or precompiling with
> -t option),
> the cursor does not return any rows. On disabling autocommit, I
> get the required number of rows from the cursor.
>
> Any idea what could be going on ?

Are you inside of a transaction?  How does the WITH or WITHOUT HOLD
function in ECPG?  From the manual:

http://www.postgresql.org/docs/current/interactive/sql-declare.html

"WITHOUT HOLD specifies that the cursor cannot be used outside of
the transaction that created it. If neither WITHOUT HOLD nor WITH
HOLD is specified, WITHOUT HOLD is the default."

-Kevin

--0-143369836-1286301078=:62990--