Re: Creating redwood datestyle in Postgres 12 - Mailing list pgsql-admin

From Tom Lane
Subject Re: Creating redwood datestyle in Postgres 12
Date
Msg-id 1578794.1616766148@sss.pgh.pa.us
Whole thread Raw
In response to Re: Creating redwood datestyle in Postgres 12  (Bruce Momjian <bruce@momjian.us>)
List pgsql-admin
Bruce Momjian <bruce@momjian.us> writes:
> On Fri, Mar 26, 2021 at 08:24:37AM -0400, Tim wrote:
>> I suppose that would be possible, but maintaining date triggers + views across
>> a large database would be a lot of work. I'm just one humble DBA and there is
>> 15-20 devs

> You probably need a custom data type with a custom C output function do
> to this efficiently.

If you're willing to write C code it likely wouldn't be that hard
to modify datetime output to honor a new datestyle value.  (Input
is messier, but since we already read this format okay, I don't
think anything is needed on that end.)

It would seem reasonable to me to have a datestyle that emits
the month as a 3-letter abbreviation, so that you could get
'2021-Mar-26' or '26-Mar-2021' etc depending on the YMD/DMY/MDY
setting.  I'd draw the line at emitting 2-digit years though.
(If you need to be that bug-compatible with Oracle, you should
stick with EDB --- that's what their AS product is for.)

            regards, tom lane



pgsql-admin by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Old query lying around in pg_stat_activity for weeks
Next
From: legrand legrand
Date:
Subject: Re: Creating redwood datestyle in Postgres 12