Re: [HACKERS] adding an immutable variant of to_date - Mailing list pgsql-hackers

From Sven R. Kunze
Subject Re: [HACKERS] adding an immutable variant of to_date
Date
Msg-id bd9db219-675e-0822-0f9b-414cbf110d5f@mail.de
Whole thread Raw
In response to Re: [HACKERS] adding an immutable variant of to_date  (Robert Haas <robertmhaas@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: "Sven R. Kunze"
Date:
Subject: Re: [HACKERS] adding an immutable variant of to_date
Next
From: Tom Lane
Date:
Subject: [HACKERS] Upgrading postmaster's log messages about bind/listen errors