Index: handlers.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/includes/handlers.inc,v
retrieving revision 1.112
diff -u -p -r1.112 handlers.inc
--- handlers.inc	3 Jun 2009 02:16:47 -0000	1.112
+++ handlers.inc	3 Jun 2009 20:27:15 -0000
@@ -827,15 +827,20 @@ function views_get_timezone() {
   }
 
   // set up the database timezone
-  if (in_array($GLOBALS['db_type'], array('mysql', 'mysqli'))) {
+  if (in_array($GLOBALS['db_type'], array('mysql', 'mysqli', 'pgsql'))) {
+    $offset = '+00:00';
     static $already_set = false;
     if (!$already_set) {
-      if ($GLOBALS['db_type'] == 'mysqli' || version_compare(mysql_get_server_info(), '4.1.3', '>=')) {
-        db_query("SET @@session.time_zone = '+00:00'");
+      if ($GLOBALS['db_type'] == 'pgsql') {
+        db_query("SET TIME ZONE INTERVAL '$offset' HOUR TO MINUTE");
       }
+      elseif ($GLOBALS['db_type'] == 'mysqli' || version_compare(mysql_get_server_info(), '4.1.3', '>=')) {
+        db_query("SET @@session.time_zone = '$offset'");
+      }
+
       $already_set = true;
     }
-  }
+  }  
 
   return $timezone;
 }
@@ -846,7 +851,7 @@ function views_get_timezone() {
  * @param $field
  *   The real table and field name, like 'tablename.fieldname'.
  * @param $field_type
- *   The type of date field, 'int' or 'datetime'.
+ *  The type of date field, 'int' or 'datetime'.
  * @param $set_offset
  *   The name of a field that holds the timezone offset or a fixed timezone
  *   offset value. If not provided, the normal Drupal timezone handling
