Same problem as #279051: pgsql named time zone detection is incorrect and #323930: db_tz_support doesn't check Postgresql correctly

  1. db_tz_support() test is invalid:

    $test = db_result(db_query("'2008-02-15 12:00:00 UTC' AT TIME ZONE 'US/Central'"));

    Should be:

    $test = db_result(db_query("SELECT '2008-02-15 12:00:00 UTC' AT TIME ZONE 'US/Central'"));

  2. After making #1 fix above, exposes this bug in sql_tz()

    return "TIMESTAMP WITH TIME ZONE $field AT TIME ZONE $localzone"; ?>

    Is not valid (at least in postgres 8.1.11), since that syntax seems to work only with literals. This should be:

    return "$field::timestamp with time zone AT TIME ZONE $localzone";

Patch attached.

CommentFileSizeAuthor
date_api_sql.patch824 bytesdivinehawk

Comments

divinehawk’s picture

Priority: Normal » Critical
suzanne.aldrich’s picture

Status: Active » Reviewed & tested by the community

Having the same issue with date-6.x-2.4. Applied patch. Issue solved. Time to roll this puppy in.

karens’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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