Re: Looking for a doc section that presents the overload selection rules

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Looking for a doc section that presents the overload selection rules
Date: 2021-10-22 18:16:14
Message-ID: b1256ad7-598b-062a-86a9-ad4d28d0dc7c@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2021-10-22 18:16:42 Re: Looking for a doc section that presents the overload selection rules
Previous Message Adrian Klaver 2021-10-22 17:51:13 Re: Looking for a doc section that presents the overload selection rules