| От | Tom Lane |
|---|---|
| Тема | Re: Why extract( ... from timestamp ) is not immutable? |
| Дата | |
| Msg-id | 28063.1327505747@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Why extract( ... from timestamp ) is not immutable? (hubert depesz lubaczewski <depesz@depesz.com>) |
| Ответы |
Re: Why extract( ... from timestamp ) is not immutable?
|
| Список | pgsql-general |
hubert depesz lubaczewski <depesz@depesz.com> 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
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера