PostgisLobTest fails against PostgreSQL 9.4

Description

PostgisLobTest still fails against a fresh PostgreSQL 9.4 test database because gt-jdbc-postgis uses postgresql-8.4-701.jdbc3.jar for tests, and although PostGISDialect faithfully writes bytea hex format for PostgreSQL 9.4, the PostgreSQL 8.4 JDBC driver cannot read bytea hex format and returns corrupted values.

Failed tests:
PostgisLobTest>OnlineTestCase.run:123->JDBCLobTest.testWrite:84 null
PostgisLobTest>OnlineTestCase.run:123->JDBCLobTest.testRead:66 null
PostgisLobTest>OnlineTestCase.run:123->JDBCLobTest.testWrite:84 null
PostgisLobTest>OnlineTestCase.run:123->JDBCLobTest.testRead:66 null

Running the unit test in Eclipse with postgresql-jdbc4-9.2.jar prepended to the classpath makes the test pass. This JDBC driver was from libpostgresql-jdbc-java 9.2-1002-1 on debian/sid. This suggests to me that the problem is the age of the JDBC driver used in the test.

This looks to me like the same failure reported in [https://jira.codehaus.org/browse/GEOT-4040" title="Support PostgreSQL 9 hex bytea output format to avoid massive data corruption" class="issue-link" data-issue-key="GEOT-4040"><del>GEOT-4040</del>. The workaround is the same:

alter database test set bytea_output = 'escape';

Tested with postgresql-9.4 9.4.0-1 amd64 on debian/sid.

Environment

None

Activity

Show:
codehaus
April 10, 2015, 3:21 PM

CodeHaus Comment From: aaime - Time: Wed, 4 Feb 2015 01:19:55 -0600
---------------------
Ben, we cannot upgrade the JDBC driver due to a bug in the new driver itself.

codehaus
April 10, 2015, 3:21 PM

CodeHaus Comment From: aaime - Time: Wed, 4 Feb 2015 01:21:05 -0600
---------------------
See discussion in the jdbc driver bug tracker. Do you have time to build a test case for them?

codehaus
April 10, 2015, 3:21 PM

CodeHaus Comment From: bencaradocdavies - Time: Wed, 4 Feb 2015 14:19:42 -0600
---------------------
Andrea, thank for linking <a href="https://jira.codehaus.org/browse/GEOT-4636" title="Upgrade PostgreSQL JDBC library" class="issue-link" data-issue-key="GEOT-4636">GEOT-4636</a>. I will have a look.

Assignee

Unassigned

Reporter

codehaus

Triage

None

Components

Affects versions

Priority

Medium
Configure