Re: ERROR: only immutable functions supported in continuous aggregate view

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ERROR: only immutable functions supported in continuous aggregate view
Дата
Msg-id 1171919.1678549672@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ERROR: only immutable functions supported in continuous aggregate view  (Martijn de Munnik <martijndemunnik@protonmail.com>)
Ответы Re: ERROR: only immutable functions supported in continuous aggregate view  (Martijn de Munnik <martijndemunnik@protonmail.com>)
Список pgsql-general
Martijn de Munnik <martijndemunnik@protonmail.com> writes:
> The error is caused by the jsonb_build_object function, is there any
> reason why this function is not IMMUTABLE?

It can invoke arbitrary datatype output functions, some of which are
not immutable.  We unfortunately lack any infrastructure that would
allow reasoning that "all the types used in this specific invocation
have immutable output functions, so it'd be OK to consider this
invocation immutable".  So we have to assume the worst when labeling
jsonb_build_object.  (Even if we had such infrastructure, I doubt
it would save you in this use-case, because it looks like some of
the values you're converting are timestamps, which respond to the
DateStyle and TimeZone settings.)

You could, on these grounds, argue that jsonb_build_object and other
functions with this problem actually need to be VOLATILE.  But we've
established a project convention that I/O functions should be at
worst STABLE, allowing calling functions to be STABLE as well.

            regards, tom lane



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

Предыдущее
От: Martijn de Munnik
Дата:
Сообщение: ERROR: only immutable functions supported in continuous aggregate view
Следующее
От: Atul Kumar
Дата:
Сообщение: confusion between max_standby_archive_delay, max_standby_archive_delay and max_standby_archive_delay