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 18:32:01
Message-ID: CAKFQuwYt4gOkaSNNj2qM4RVi_wYDk3i48JDvogm5kYMvq-thDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jan 10, 2022 at 9:33 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> The core of the difficulty is that although timestamptz_out
> is getting called, that's nowhere visible in the parse tree.
> I suppose we could decide that it's illegal to allow
> array_to_string() or format() to exist, but I don't think
> anybody will like that answer.
>

Yeah. The user expectation (and arguably architectural ideal) that the
output representation of data types is immutable being violated is the
bigger issue here but one that we are basically stuck with. As you note
below, however, since real complaints mostly manifest in polymorphic
situations, coming up with a solution at that scope, one that makes
function volatility a planning time property instead of a create function
time one, makes the most sense. Since the function is being defined for
planning time type resolution, extending that to volatility is internally
consistent.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2022-01-10 19:31:58 Re: BUG #17255: Server crashes in index_delete_sort_cmp() due to race condition with vacuum
Previous Message Tom Lane 2022-01-10 16:33:54 Re: BUG #17360: array_to_string should be immutable instead of stable