Re: BUG #17360: array_to_string should be immutable instead of stable

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #17360: array_to_string should be immutable instead of stable
Дата
Msg-id CAKFQuwYnTszfLGcwGfyUxEXo6HjyqXK8wrbC_vrpZ64pgw=A4Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17360: array_to_string should be immutable instead of stable  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs


On Mon, Jan 10, 2022, 08:54 David G. Johnston <david.g.johnston@gmail.com> wrote:
On Mon, Jan 10, 2022 at 7:54 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
PG Bug reporting form <noreply@postgresql.org> writes:
> The array_to_string function should have a volatility of immutable,

Nope.  It invokes an arbitrary datatype I/O function,
which might only be stable.  As an example:

regression=# begin;
BEGIN
regression=*# select array_to_string(array[now()], ',');

That feels wrong.  It's not like we are passing the "now()" function to the function and invoking it later.  So far as array_to_string is concerned it is being given a literal value.


Nevermind.  It's the internal timestampt to text cast I'm forgetting.

David k


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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #17360: array_to_string should be immutable instead of stable
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17360: array_to_string should be immutable instead of stable