diff options
author | Yorhel <git@yorhel.nl> | 2009-08-06 17:44:11 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-08-06 17:44:11 +0200 |
commit | 1efef2763236ab42d71a34ed90a1a31579443b9d (patch) | |
tree | 28973d186cc76d6ca2e8beb487d578cffc2354b8 /ChangeLog | |
parent | 753a2d8c6b69ae86e5968b9672992b7b60341067 (diff) |
Use timestamptz data type instead of timestamp
It took me a while to figure out that the "timestamp with timezone"
PostgreSQL type doesn't actually store the time zone, it simply stores
and calculates on UTC, and only converts it to the connection time zone
in the formatting stage before sending it to the SQL client.
When working with date/times in PgSQL, the NOW() (and related) functions
return a timestamp with time zone. Upon converting that to a timestamp
without time zone type, the current timezone setting is used. Meaning
that comparing a column of type timestamp without timezone to NOW() will
only work if all data in the columns is stored in the same timezone as
that of the current connection, which in turn means that changing this
setting at any point will cause all data in timestamp without timezone
columns to be incorrectly interpreted.
I often praise PostgreSQL for their comprehensive documentation, but
they could've pointed this out more clearly...
Diffstat (limited to 'ChangeLog')
0 files changed, 0 insertions, 0 deletions