Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UfVMr-0006ww-F5 for pgsql-odbc@arkaria.postgresql.org; Thu, 23 May 2013 13:15:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UfVMq-0008UL-PC for pgsql-odbc@arkaria.postgresql.org; Thu, 23 May 2013 13:15:40 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UfVMp-0008UF-V0 for pgsql-odbc@postgresql.org; Thu, 23 May 2013 13:15:40 +0000 Received: from sd.tpf.co.jp ([210.161.239.34]) by makus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UfVMj-0005e6-36 for pgsql-odbc@postgresql.org; Thu, 23 May 2013 13:15:39 +0000 Received: (qmail 18164 invoked by uid 512); 23 May 2013 13:15:30 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 23 May 2013 13:15:30 -0000 Received: from unknown (HELO ?192.168.1.3?) (110.5.25.94) by sd.tpf.co.jp with SMTP; 23 May 2013 13:15:30 -0000 Message-ID: <519E166F.7020905@tpf.co.jp> Date: Thu, 23 May 2013 22:15:27 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Joe Conway CC: "pgsql-odbc@postgresql.org" Subject: Re: ODBC does not handle WITH clause References: <519BF4F6.9020200@joeconway.com> In-Reply-To: <519BF4F6.9020200@joeconway.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.3 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org Hi Jack, (2013/05/22 7:28), Joe Conway wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > It seems the ODBC driver does not deal well with a WITH clause in a > statement: > > 8<---------------------------------- > SQL> select id from generate_series(1,2) as t(id) > +------------+ > | id | > +------------+ > | 1 | > | 2 | > +------------+ > SQLRowCount returns -1 > 2 rows fetched . . > SQL> with w as (select id from generate_series(1,2) as t(id)) select > w.id from w > SQLRowCount returns 0 > SQL> select id from generate_series(1,2) as t(id) > [ISQL]ERROR: Could not SQLExecute Thanks for the report. > 8<---------------------------------- > > The last statement fails (according to the logs) because: > ERROR: cursor "SQL_CUR0x17c4bd0" already exists > > At that point the only recovery is ABORT. > > 8<---------------------------------- > > This is with the latest odbc package on Linux Mint 14, but I have seen > it on a client machine based on current Red Hat as well. Is this a > known issue? AFAIK no. Psqlodbc drivers take care of with clause just a little. As for the ERROR message, possibly I found at least one of the cause. Could you test the change when I make a patch? regards, Hiroshi INoue -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc