[openstreetmap-website] Switch to TIMESTAMP WITH TIME ZONE for current_* tables (#375)
vincentdephily
notifications at github.com
Mon Jul 22 09:51:19 UTC 2013
First thing first: there is no storage overhead for the 'with timezone' variant, as [postgres always stores in UTC](http://www.postgresql.org/docs/9.2/static/datatype-datetime.html#DATATYPE-TIMEZONES). The only (tiny) overhead is the on-the-fly timezone conversion if the client needs it.
The advantage of using 'with timezone' is to fend off client bugs. If the client is smart, he'll know to expect UTC (or whatever is used by convention), but experience shows that clueless clients _will_ happen. At work I've had a few instances of having to force a client timezone (by editing the db user's properties) to work around client bugs. To avoid drama, the database driver or proxy can inform the server what is the client-expected timezone.
That said, if you are dead sure that all osm clients know that they are geting UTC from the db and do the conversion-before-printing work themselves, you can keep using 'without timezone'. But for such a distributed project as osm, it's probably better to play it safe.
---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/375#issuecomment-21334365
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20130722/996df587/attachment.html>
More information about the rails-dev
mailing list