Re: Looking for a doc section that presents the overload selection rules - Mailing list pgsql-general

From David G. Johnston
Subject Re: Looking for a doc section that presents the overload selection rules
Date
Msg-id CAKFQuwbMJwt5gfKV+m+pTRFSAw66s8+Dpf-3hw6M-JN+p-HqXg@mail.gmail.com
Whole thread Raw
In response to Re: Looking for a doc section that presents the overload selection rules  (Bryn Llewellyn <bryn@yugabyte.com>)
Responses Re: Looking for a doc section that presents the overload selection rules
List pgsql-general
On Friday, October 22, 2021, Bryn Llewellyn <bryn@yugabyte.com> wrote:
There could, so easily, have been three “to_char()” overloads for these three data types that honored the spirit of the “::text” typecast by rendering only what’s meaningful, despite what the template asks for.

Even if we added to_char(date…) having it produce output “despite what the template asks for” is going to be questionable.  At least this way we are honest about what we are doing - if you don’t want non-date stuff in the output don’t have it in the template.  Unless the behavior is going to differ from what you can get today adding a new function doesn’t have a benefit.  It’s unclear whether having different behavior is desirable.

The argument about avoiding the implicit cast, and thus being easier for newcomers to figure out, is the compelling one for me.  But, frankly, “it just works” applies here - I’ve seen little evidence that there is a meaningful usability issue in the community.

David J.

pgsql-general by date:

Previous
From: Rob Sargent
Date:
Subject: Re: Looking for a doc section that presents the overload selection rules
Next
From: Bryn Llewellyn
Date:
Subject: Re: Looking for a doc section that presents the overload selection rules