title: PostgreSQL 9.2 JDBC driver uses client time zone?
body: <p>I've run into an interesting challenge using a PostgreSQL database with the PostgreSQL JDBC driver. It seems that the latest version of the driver, 9.2, uses the <em>client</em> time zone when performing date/time matches.</p>
  
  <p>This becomes a problem when the server (JasperReports Server) is set to UTC and the database server is set to US/Eastern. </p>
  
  <p>If I run the following query from a client set to the UTC time zone I get different results using the 9.0 JDBC driver and the 9.2 JDBC driver.</p>
  
  <pre><code>select now(), extract(timezone FROM now()), current_setting('TIMEZONE'), now()-interval '1 hour' as "1HourAgo"
  </code></pre>
  
  <p>Results using 9.0 JDBC driver:</p>
  
  <pre><code>now                         date_part   current_setting     1HourAgo
  2013-08-26 15:33:57.590089  -14,400     US/Eastern          2013-08-26 14:33:57.590089
  </code></pre>
  
  <p>Results using 9.2 JDBC driver:</p>
  
  <pre><code>now                         date_part   current_setting     1HourAgo
  2013-08-26 15:41:49.067903  0           UTC                 2013-08-26 14:41:49.067903
  </code></pre>
  
  <p>This is causing a WHERE statement in a query to return incorrect results. For example,</p>
  
  <pre><code>WHERE end_time between now() - interval '1 hour' and now()
  </code></pre>
  
  <p>works as expected using the 9,0 driver but returns no results using the 9,2 driver as the driver appears to be offsetting the value of end_time to match UTC (the client's time zone). The following is a workaround, but an ugly one:</p>
  
  <pre><code>WHERE end_time at time zone 'EDT' between now() - interval '1 hour' and now()
  </code></pre>
  
  <p>Questions:</p>
  
  <ol>
  <li>Has anyone else run across this before?</li>
  <li>Is there an explanation for this change in behavior? I haven't been able to find anything in the JDBC release notes</li>
  <li>Any advice on how to work around this other than rolling back the driver to an older version?</li>
  </ol>
  
  <p>Thanks!</p>