Index: date.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/date/date.inc,v
retrieving revision 1.27.2.23
diff -u -r1.27.2.23 date.inc
--- date.inc	8 Mar 2007 11:50:24 -0000	1.27.2.23
+++ date.inc	8 Mar 2007 12:39:12 -0000
@@ -2247,7 +2247,7 @@
         // php date functions and postgres use 0 for Sunday and 6 for Saturday
         return "INTEGER(DAYOFWEEK($field) - 1)";
       case ('pgsql'):
-        return "DOW($field)";
+        return "EXTRACT (DOW FROM($field))";
     }
   case ('DOY'):
     switch ($db_type) {
@@ -2255,7 +2255,7 @@
       case ('mysqli'):
         return "DAYOFYEAR($field)";
       case ('pgsql'):
-        return "DOY($field)";
+        return "EXTRACT (DOY FROM ($field))";
     }
   }
 }
@@ -2353,4 +2353,4 @@
  */
 function theme_date_form_timezone($form) {
   return drupal_render($form);
-}
\ No newline at end of file
+}
