Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lPmjU-0004IW-51 for pgsql-admin@arkaria.postgresql.org; Fri, 26 Mar 2021 13:42:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lPmjT-00070z-0U for pgsql-admin@arkaria.postgresql.org; Fri, 26 Mar 2021 13:42:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lPmjS-00070r-Or for pgsql-admin@lists.postgresql.org; Fri, 26 Mar 2021 13:42:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lPmjQ-0004LJ-2M for pgsql-admin@lists.postgresql.org; Fri, 26 Mar 2021 13:42:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 12QDgSdv1578795; Fri, 26 Mar 2021 09:42:29 -0400 From: Tom Lane To: Bruce Momjian cc: Tim , Paul Smith , pgsql-admin@lists.postgresql.org Subject: Re: Creating redwood datestyle in Postgres 12 In-reply-to: <20210326123555.GA18244@momjian.us> References: <5273bd68ae53e76fb592249ba05433b4bb645660.camel@cybertec.at> <20210326123555.GA18244@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Fri, 26 Mar 2021 08:35:55 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1578793.1616766148.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 26 Mar 2021 09:42:28 -0400 Message-ID: <1578794.1616766148@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bruce Momjian writes: > On Fri, Mar 26, 2021 at 08:24:37AM -0400, Tim wrote: >> I suppose that would be possible, but maintaining=C2=A0date triggers + = views across >> a large database would be a lot of work. I'm just one humble DBA and th= ere 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