From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: Tim <timfosho@gmail.com>
Cc: Paul Smith <paul@pscs.co.uk>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Creating redwood datestyle in Postgres 12
Date: Fri, 26 Mar 2021 09:42:28 -0400
Message-ID: <1578794.1616766148@sss.pgh.pa.us> (raw)
In-Reply-To: <20210326123555.GA18244@momjian.us>
References: <CAKhLO5jDy8bMop66WU8cNUFcfSuL1==FyGvawKZT-CC2FYuZXQ@mail.gmail.com>
<5273bd68ae53e76fb592249ba05433b4bb645660.camel@cybertec.at>
<CAKhLO5i-PJdeX2q8eEzYVs91bzw1bDJxaSL_tD96XhnmGVAJfg@mail.gmail.com>
<d31d1a49-2394-e18b-f810-0a2832826f34@pscs.co.uk>
<CAKhLO5iqHP2YtNW+a5UVZoXC7M7xy=BUd3oZs1UD00fZzfhfhw@mail.gmail.com>
<20210326123555.GA18244@momjian.us>
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
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, bruce@momjian.us, timfosho@gmail.com, paul@pscs.co.uk, pgsql-admin@lists.postgresql.org
Subject: Re: Creating redwood datestyle in Postgres 12
In-Reply-To: <1578794.1616766148@sss.pgh.pa.us>
* 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