Re: ODBC does not handle WITH clause - Mailing list pgsql-odbc

From Hiroshi Inoue
Subject Re: ODBC does not handle WITH clause
Date
Msg-id 519E166F.7020905@tpf.co.jp
Whole thread Raw
In response to ODBC does not handle WITH clause  (Joe Conway <mail@joeconway.com>)
Responses Re: ODBC does not handle WITH clause  (Joe Conway <mail@joeconway.com>)
List pgsql-odbc
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



pgsql-odbc by date:

Previous
From: Sam Varshavchik
Date:
Subject: Cursor for a positioned update: "cursor doesnot exist" error
Next
From: Hiroshi Inoue
Date:
Subject: Re: Cursor for a positioned update: "cursor does not exist" error