Search Postgresql Archives

Re: Why extract( ... from timestamp ) is not immutable?

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

 



hubert depesz lubaczewski <depesz@xxxxxxxxxx> writes:
> Why aren't the 3rd date_parts the same in both cases? I mean - I see that they
> are adjusted due to timezone, but why is it happening?

Given a timestamp without time zone, timestamp_part('epoch') assumes
that it is in session timezone, and rotates it back to UTC so as to
satisfy the expectation that epoch values start from zero at midnight
UTC.  In short, the calculation you're showing does the zone correction
an extra time.  Don't do that.

			regards, tom lane

-- 
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