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

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: [GENERAL] Why extract( ... from timestamp ) is not immutable?
Дата
Msg-id 20120130185351.GA21624@depesz.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Why extract( ... from timestamp ) is not immutable?  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: [GENERAL] Why extract( ... from timestamp ) is not immutable?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, Jan 30, 2012 at 10:35:21AM -0800, Josh Berkus wrote:
> 
> > 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.

but this is exactly what's happening now.
extract( ... from timestamp) is marked as immutable, while in some cases
(namely when you want epoch) it should be stable because the return from
function changes.

Best regards,

depesz

-- 
The best thing about modern society is how easy it is to avoid contact with it.
                  http://depesz.com/
 


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: [GENERAL] Why extract( ... from timestamp ) is not immutable?
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Group commit, revised