pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Looking for a doc section that presents the overload selection rules
Date: Fri, 22 Oct 2021 12:16:14 -0600
Message-ID: <b1256ad7-598b-062a-86a9-ad4d28d0dc7c@gmail.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>


> 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.
>
> 			regards, tom lane

Going down that path I would be sorely tempted to default the format 
text to the style I typically want.

    create function to_char(dt date, fmt text default 'dd-Mon-yyyy TZH:TZM') returns text

view thread (15+ messages)  latest in thread

Message-ID: <b1256ad7-598b-062a-86a9-ad4d28d0dc7c@gmail.com>
Permalink:  ../b1256ad7-598b-062a-86a9-ad4d28d0dc7c@gmail.com/
Also on:    postgresql.org/message-id/b1256ad7-598b-062a-86a9-ad4d28d0dc7c@gmail.com

 · 

reply

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: robjsargent@gmail.com
  Subject: Re: Looking for a doc section that presents the overload selection rules
  In-Reply-To: <b1256ad7-598b-062a-86a9-ad4d28d0dc7c@gmail.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> <b1256ad7-598b-062a-86a9-ad4d28d0dc7c@gmail.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