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

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: [GENERAL] Why extract( ... from timestamp ) is not immutable?
Дата
Msg-id 4F26E2E9.50802@agliodbs.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Why extract( ... from timestamp ) is not immutable?  (hubert depesz lubaczewski <depesz@depesz.com>)
Ответы Re: [GENERAL] Why extract( ... from timestamp ) is not immutable?  (hubert depesz lubaczewski <depesz@depesz.com>)
Список pgsql-hackers
> preferably I would see extract( epoch from timestamp ) to be really
> immutable, i.e. (in my opinion) it should treat incoming data as UTC
> - for epoch calculation.
> Alternatively - perhaps epoch extraction should be moved to specialized
> function, which would have swapped mutability:

We can't have functions which are immutable or not depending on their
inputs.  That way lies madness.

> get_epoch(timestamptz) would be immutable
> while
> get_epoch(timestamp) would be stable

Well, to_epoch, in order to be consistent with other conversion functions.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gilles Darold
Дата:
Сообщение: Patch pg_is_in_backup()
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: [GENERAL] Why extract( ... from timestamp ) is not immutable?