Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] PostgreSQL timestamp with zone type support

#3777

The current Rails practice with PostgreSQL is to use timestamp without zone and use ActiveRecord's time zone handling. This works fine for Rails but makes it slightly inconvenient for ad hoc, local time queries outside of Rails. With this patch ActiveRecord sets the connection time to UTC when creating the connection if AR::Base.default_timezone is :utc. Rails can then handle time zones its way and other clients can use PostgreSQL's time zone handling.

Reported by JackC · January 24th, 2010 @ 02:35 AM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Repository
    Repository
    • State changed from new to resolved

    (from [c5b652f3d25ef92ae0f67551464fb03bda6aeb4f]) PostgreSQLAdapter: set time_zone to UTC when Base.default_timezone == :utc so that Postgres doesn't incorrectly offset-adjust values inserted into TIMESTAMP WITH TIME ZONE columns [#3777 [PATCH] PostgreSQL timestamp with zone type support state:resolved] http://github.com/rails/rails/commit/c5b652f3d25ef92ae0f67551464fb0...

    January 26th, 2010 @ 02:58 AM