On Tue, Apr 1, 2014 at 4:18 PM, Kjetil Nygård <polpot78@gmail.com> wrote:
I try to build with the tests, but when I run the test org.postgresql.test.jdbc2.StatementTest.testDateFunctions() i get: junit.framework.AssertionFailedError: expected:<-3> but was:<-2>
When I run the same function directly in PostgreSQL, I also get -2:
test=> select extract( day from ((CAST(-3 || ' day' as interval)+now())-now())); date_part ----------- -2
When I remove the extract day from the expression, I get: test=> select CAST(-3 || ' day' as interval)+now()-now(); ?column? ------------------- -2 days -23:00:00
Which should give the same timezone, but they are in +01 and +02.
This seems like a timezone problem, but I do not yet fully understand why. My timezone is "Europe/Oslo". My PostgreSQL version is 9.3.4, from PostgreSQL's YUM-repo.
PS: I sent this to both bugs and pgjdbc as it is a bug in PostgreSQL and affects pgjdbc.