Search Postgresql Archives

Re: date with month and year

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Anyway, I agree that you have to store the time zone *somewhere*, and I 
> suppose that's the reason Joshua remarked that you really shouldn't use 
> WITHOUT TIME ZONE. And often a time has one perspective that is 
> "canonical" or "preferred", e.g. the time zone of the user who created 
> the object. And in that case WITH TIME ZONE gives you a convenient place 
> to store that.

No it doesn't.

WITH TIME ZONE simply means that whatever the user sends to
the database is meant to represent that time zone.

As far as PostgreSQL is concerned it will convert that
to UTC, store UTC

   AND THROW AWAY THE TIMEZONE INFORMATION

While that's correct in mathematical terms (the stored instant-in-time
is *known* to be "good" at UTC) it does throw away information, namely
the storing-client-timezone data. If you want to retain that (rather
than convert UTC to the retrieving client's timezone) you'll have to
store that yourself in an extra field.

> I think I still prefer a more "relativistic" approach 
> where times have no preferred perspective,

That's meaningless. Time has, by its very definition, a perspective. It's
just that for "canonical" times people usually agree on storing the
perspective "UTC". Other than that it would be akin to a byte string
without encoding -- you can't tell what it means.

Karsten


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux