Re: adding an immutable variant of to_date

From: "Sven R(dot) Kunze" <srkunze(at)mail(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andreas Karlsson <andreas(at)proxel(dot)se>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: adding an immutable variant of to_date
Date: 2017-03-09 20:20:35
Message-ID: bd9db219-675e-0822-0f9b-414cbf110d5f@mail.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 08.03.2017 03:37, Robert Haas wrote:
> The commit message for 64353640e87b54250f1b8a1d2a708d270dff4bfd has
> some interesting perspective on this.

"""
Also, mark to_date() and to_char(interval) as stable; although these appear
not to depend on any GUC variables as of CVS HEAD, that seems a property
unlikely to survive future improvements. It seems best to mark all the
formatting functions stable and be done with it.
"""

My take away from this commit is the following:

Historically, the immutability of "to_date(text, text)" was an emergent
feature. Proven to be possibly mutable, the parsing feature had a higher
priority, so the immutability needed to be removed.

The proposed variant on the other hand should be immutable first before
everything else. Thus, future improvements cannot violate that. This
might restrict the possible parsing functionality but that shouldn't be
a problem in practice.

Regards,
Sven

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-03-09 20:27:25 Upgrading postmaster's log messages about bind/listen errors
Previous Message Sven R. Kunze 2017-03-09 20:09:20 Re: adding an immutable variant of to_date