pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: ODBC does not handle WITH clause
Date: Tue, 21 May 2013 15:28:06 -0700
Message-ID: <519BF4F6.9020200@joeconway.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

-----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> select w.id from (select id from generate_series(1,2) as t(id)) as w
+------------+
| 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
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<----------------------------------
SQL> abort
SQLRowCount returns 0
SQL> select id from generate_series(1,2) as t(id)
+------------+
| id         |
+------------+
| 1          |
| 2          |
+------------+
SQLRowCount returns -1
2 rows fetched
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?

Thanks,

Joe


- -- 
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRm/T1AAoJEDfy90M199hl5ZgQAJ1IIyHggS5IGf+HqRqVizl1
GUqrPP0gK5SzMHWvPacVRZyGyZZogjy7zW6w69I6zlQtxZ++EZCzBe5uSCwVU+Bb
uQ7TsR/RBJoe0ftSDBiID52p3MJp/hbhhNJgi8Pky2GyntvEYuBe4YIFqAocfgts
MSVmU19zujpL1AKXsjUW9Viql+7bk9AT/Qz8RZARtLJ0XbwUuSHWiVphVzY5PuBt
DdjOZ8IzQken2WckvSkRkgkmeked18/3/TqzhApaWJAnOpak6Xl2n5ITre5lnnIa
IMQq6e2tu9UlKPrlNA9Y6gjirDgUqxas9uflqHfWrI0ks/uE8q6oIZ/ZPamnT8/e
kaoIVs6u5pt/zKcIRuKR05oOzdt/ZWzM+8cH+YlrcmNYROikoN4m2K96PHN/MgFb
FUJqAX0mFyrAKObNhN1giqWTpwVsSKkK82jVGGH2CfTNcdPdJlmMx3xvDUk5vMZe
Ocl0EGBV3rK7kdjn1/xcEASve0/WzS/LKVx4uKiqyBJ8we0xrcYXJ4IBZcu2BzC0
c+bqxJ+nDHDEU1dvPcwUZyh4s61OVKU0fbvgxTONizi90DMlf+cTkP4tnrjS5fai
DMxlojL7n6FzCt4oNNsufEqooG3dhcc3Mih0PKVltUhvIcA30LpDGPkl0R376fWV
9r1Et3Z2o/AIrD9LdQ48
=acL+
-----END PGP SIGNATURE-----


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



view thread (5+ messages)  latest in thread

Message-ID: <519BF4F6.9020200@joeconway.com>
Permalink:  ../519BF4F6.9020200@joeconway.com/
Also on:    postgresql.org/message-id/519BF4F6.9020200@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: mail@joeconway.com
  Subject: Re: ODBC does not handle WITH clause
  In-Reply-To: <519BF4F6.9020200@joeconway.com>
  References: <519BF4F6.9020200@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox