Issue Type: Bug Bug
Affects Versions: 11-beta
Assignee: Justin Deoliveira
Components: jdbc-postgis plugin
Created: 02/Oct/13 3:49 AM
Description:

It looks like there is a new timezone handling issue introduced between PostgreSQL 9.1 and 9.3.

org.geotools.data.postgis.PostgisUDTTest (the plain one, not the prepared statement test) fails against 9.3 with:

Failed tests: 
  PostgisUDTTest>OnlineTestCase.run:123->testRead:81 null expected:<2004-10-3[0 17]:30:00.0> but was:<2004-10-3[1 01]:30:00.0>

In PostgisUDTTestSetup the following non-timezone timestamp literal is used but then inserted into a with-timezone timestamptz column:

'2004-10-30 17:30'::timestamp

The PostgreSQL 9.3 failure occurs at this point.

assertEquals("2004-10-30 17:30:00.0", item.getAttribute(aname("ut12")).toString());

It looks like the timestamp literal is being parsed as 'GMT' (the database TimeZone) but encoded in the system timezone is Australia/Perth.

The workaround is to change the database TimeZone from 'GMT' to 'Australia/Perth' to match the system:

alter database test set TimeZone to 'Australia/Perth';

The test then passes. This should not be necessary.

I am not quite sure what the change is that causes this problem. There are a few time related changes:
http://www.postgresql.org/docs/9.2/static/release-9-2.html
http://www.postgresql.org/docs/9.3/static/release-9-3.html

Perhaps the casting from timestamp to timestamptz changed? Perhaps the literal could be changed to include a timestamp to make this test more robust?

Environment: postgresql-9.3 9.3.0-2 amd64 on debian/sid,
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 21:51:28+0800)
Maven home: /home/car605/junk/java/maven3
Java version: 1.6.0_45, vendor: Sun Microsystems Inc.
Java home: /home/car605/junk/java/jdk1.6.0_45.x64/jre
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "3.10-3-amd64", arch: "amd64", family: "unix"
Project: GeoTools
Priority: Major Major
Reporter: Ben Caradoc-Davies
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to