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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: gergely(dot)czuczy(at)harmless(dot)hu, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17360: array_to_string should be immutable instead of stable
Date: 2022-01-10 16:17:06
Message-ID: CAKFQuwYnTszfLGcwGfyUxEXo6HjyqXK8wrbC_vrpZ64pgw=A4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jan 10, 2022, 08:54 David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
wrote:

> On Mon, Jan 10, 2022 at 7:54 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> PG Bug reporting form <noreply(at)postgresql(dot)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

>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-01-10 16:33:54 Re: BUG #17360: array_to_string should be immutable instead of stable
Previous Message David G. Johnston 2022-01-10 15:54:03 Re: BUG #17360: array_to_string should be immutable instead of stable