Skip to content

Timestamps with time zone broken #535

@MSch

Description

@MSch

Seems like Ecto 0.9 has broken support for timestamps with time zone. Adding the following after create table(:posts) in integration_test/support/migration.exs breaks the tests:

execute "ALTER TABLE posts ALTER COLUMN inserted_at TYPE timestamp with time zone;"

I tried to do some investigating but didn't get far.


Related: Specifying :datetime in migrations should create a column of type timestamp with time zone, not timestamp without time zone:

Long story short – I believe that using timestamps (without time zone) is, in almost every case, a bug. And should be fixed.

http://www.depesz.com/2014/04/04/how-to-deal-with-timestamps/

Use timestamp with time zone (aka timestamptz) and time with time zone (aka timetz). They store values as UTC, but convert them on selection to whatever your time zone setting is.
Avoid timestamp without time zone (aka timestamp)

http://justatheory.com/computers/databases/postgresql/use-timestamptz.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions