kashipai / h2database

H2 Database for reference.
0 stars 0 forks source link

PgServer does not work with any recent Postgres JDBC driver #472

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Run the TestPgServer integration test while providing any of the drivers at 
http://jdbc.postgresql.org/download.html.

What is the expected output? What do you see instead?

Depending on the driver version, either a IndexOutOfBoundsException (the most 
common) or an SQL exception around a missing PG_GET_EXPR.

What version of the product are you using? On what operating system, file
system, and virtual machine?

* H2 1.3.172
* PG JDBC Drivers: postgresql-8.1-415.jdbc3.jar, postgresql-8.2-512.jdbc3.jar, 
postgresql-8.4-703.jdbc3.jar, postgresql-9.0-802.jdbc3.jar, 
postgresql-9.1-903.jdbc3.jar, postgresql-9.2-1002.jdbc3.jar

Do you know a workaround?

I have attached a patch which will at least make the unit test run on the JDBC 
driver from 8.1 to 9.1. I suspect the patch would solve other existing 
problems, eg. issue #470. The 9.2 driver would work except that transmitting 
the types in binary is the default in this version, which isn't yet supported 
in PgServerThread.

Original issue reported on code.google.com by arbfrank...@gmail.com on 8 Jun 2013 at 1:55

Attachments:

GoogleCodeExporter commented 9 years ago
Note, I have added support for PG JDBC 9.2 in the ticket #477.

Original comment by arbfrank...@gmail.com on 10 Jun 2013 at 3:54

GoogleCodeExporter commented 9 years ago
Hmmm, I'm not that familiar with the internals of the driver, but it looks like 
your change to PgServerThread will break backwards compatibility with older 
versions of the ODBC driver, assuming that the 'E' command is currently in use 
and working correctly.

Perhaps there is a PostgreSQL-ODBC version somewhere where you could turn this 
particular section of code on and off depending on the version of the driver 
connecting?

Original comment by noelgrandin on 18 Jun 2013 at 12:37

GoogleCodeExporter commented 9 years ago
I read over the protocol spec and it seemed like an error that the prior 
PostgreSQL ODBC driver was resilient to. If you're able to share what you 
believe the officially supported ODBC/JDBC drivers are prior to my change then 
I can do some regression testing.

Original comment by arbfrank...@gmail.com on 18 Jun 2013 at 9:38

GoogleCodeExporter commented 9 years ago
Attached an updated patch which is relative to the now current trunk. It also 
includes a slight improvement in null + boolean handling and type warning which 
is possibly more an extension to issue #477 but is about more accurate driver 
handling. You may wish to split commits here?

In terms of regression testing PG ODBC, I tried out a 8.0 series driver and it 
works fine, as does the 9.0.

Original comment by arbfrank...@gmail.com on 19 Jun 2013 at 9:57

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, looks good, patch applied.

Original comment by noelgrandin on 20 Jun 2013 at 6:52