From: Bryn Llewellyn <bryn@yugabyte.com>
To: Tom Lane PostgreSQL <tgl@sss.pgh.pa.us>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: Looking for a doc section that presents the overload selection rules
Date: Fri, 22 Oct 2021 11:41:17 -0700
Message-ID: <84D51FB6-67CD-4901-816D-ECBB8A6352DD@yugabyte.com> (raw)
In-Reply-To: <2723042.1634924892@sss.pgh.pa.us>
References: <4F35D95E-4974-44FC-AA4B-3F1E94580B82@yugabyte.com>
<b9d87b72-aaf2-1d6a-951a-d67f866fbd66@aklaver.com>
<F71D1FD3-F0A9-48F1-B8F2-9018D6D0DF31@yugabyte.com>
<4f7a9fe8-ea27-e4a3-34ac-f05fcfb7f5c3@aklaver.com>
<B4E55133-926B-4A0D-8E17-C0EE984531E7@yugabyte.com>
<36e3e2a5-cf09-61e2-3f12-3ea6d17e3ccd@aklaver.com>
<476BE5DC-8D86-422B-9463-C41696271A22@yugabyte.com>
<2723042.1634924892@sss.pgh.pa.us>
> tgl@sss.pgh.pa.us wrote:
>
> Bryn Llewellyn <bryn@yugabyte.com> writes:
>> 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.
>
> You can, of course, trivially make that so in your own database.
>
> =# create function to_char(date, text) returns text
> language sql stable strict parallel safe
> as 'select pg_catalog.to_char($1::timestamp without time zone, $2)';
>
> =# select to_char(current_date, 'dd-Mon-yyyy TZH:TZM');
> to_char
> --------------------
> 22-Oct-2021 +00:00
> (1 row)
>
> Regardless of whether the original choice not to have this variant
> was intentional or an oversight, I'd be pretty loath to change it now
> because of backwards compatibility. But Postgres is adaptable.
Thanks, Tom. I’d also reached that same conclusion. But I won’t do that. Rather, I’ll advise myself and anyone who asks me to do what I just wrote in reply to David Johnston.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: bryn@yugabyte.com, tgl@sss.pgh.pa.us, adrian.klaver@aklaver.com, david.g.johnston@gmail.com
Subject: Re: Looking for a doc section that presents the overload selection rules
In-Reply-To: <84D51FB6-67CD-4901-816D-ECBB8A6352DD@yugabyte.com>
References: <4F35D95E-4974-44FC-AA4B-3F1E94580B82@yugabyte.com> <b9d87b72-aaf2-1d6a-951a-d67f866fbd66@aklaver.com> <F71D1FD3-F0A9-48F1-B8F2-9018D6D0DF31@yugabyte.com> <4f7a9fe8-ea27-e4a3-34ac-f05fcfb7f5c3@aklaver.com> <B4E55133-926B-4A0D-8E17-C0EE984531E7@yugabyte.com> <36e3e2a5-cf09-61e2-3f12-3ea6d17e3ccd@aklaver.com> <476BE5DC-8D86-422B-9463-C41696271A22@yugabyte.com> <2723042.1634924892@sss.pgh.pa.us> <84D51FB6-67CD-4901-816D-ECBB8A6352DD@yugabyte.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox