when I upgraded my postgres from 8.1.x to 8.3.3, the stricter type enforcement in this blew out my 'events' view which is using Date fields...

fix is to add a cast to this code in date.inc

old code:

  // Get rid of the 'T' in ISO dates to match native date field.
  // This makes it possible to use SQL date functions on the value.
  elseif ($date_type == 'iso' && $field) {
    $field = " REPLACE($field,'T',' ')";

new code...

  // Get rid of the 'T' in ISO dates to match native date field.
  // This makes it possible to use SQL date functions on the value.
  elseif ($date_type == 'iso' && $field) {
    $field = " cast(REPLACE($field,'T',' ') as date)";

i haven't regression tested this under older versions of postgres and/or on mysql.

fyi, my content types have a a simple Date field, the site is using PDT timezone, and the view that triggered the error is using Date: Date - Date (field_date) in a filter as >= "now" - an offset

Comments

KarenS’s picture

Status: Active » Fixed

This has been changed in the 5.2 version, which now uses "TO_DATE($field, 'FMYYYY-FMMM-FMDDTFMHH:FMMI:FMSS')".

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.