pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: BUG #16419: wrong parsing BC year in to_date() function
Date: Wed, 30 Sep 2020 18:36:37 -0400
Message-ID: <941402.1601505397@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoaZ9w=WwmE3xRUCN0bSzYp14kU6_MAy-wJUpgpDmVMYpA@mail.gmail.com>
References: <16419-d8d9db0a7553f01b@postgresql.org>
	<CAKFQuwYPjq=UAHNZ6KtHuJPA8pmttV3X+imFYcBQqNUGWsCexg@mail.gmail.com>
	<AM0PR03MB3570F99911704BFC77294DA1BFA50@AM0PR03MB3570.eurprd03.prod.outlook.com>
	<CAKFQuwaXESne_VYt8bE8L5gGGqEM0TCGL+JNL1a8NJ2_uc8VfQ@mail.gmail.com>
	<CAKFQuwajC7+s-nHRujP+w5GsUTcp8usazdPas59Kz3kCTq+e3w@mail.gmail.com>
	<0123b852ae3fe53eca11b9451d035411b06dafd5.camel@cybertec.at>
	<CAKFQuwb_3yNTTE6cG_YtXFtV=CkQf0uMSMB0oxC1YNrF94pfuA@mail.gmail.com>
	<20200904012149.GA13932@momjian.us>
	<CAKFQuwZV0UxbyYTxuJhf1j1X=3HG5QA6qtEp+C+=LzOFtNEt3A@mail.gmail.com>
	<20200904201224.GD6891@momjian.us>
	<663099.1601400389@sss.pgh.pa.us>
	<CA+TgmoameT7ysPOm2sqp6NaZtzP0QFNjJ09wC1QVKTzt-84D7Q@mail.gmail.com>
	<911841.1601501743@sss.pgh.pa.us>
	<CA+TgmoaZ9w=WwmE3xRUCN0bSzYp14kU6_MAy-wJUpgpDmVMYpA@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Sep 30, 2020 at 5:35 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> By that logic, we should never fix any bug in a back branch.

> No, by that logic, we should not change any behavior in a back-branch
> upon which a customer is plausibly relying.

I guess where we differ here is on the idea that somebody is plausibly
relying on to_date() to parse a BC date inaccurately.

> One reason they might do that is because there was a discussion about
> what I believe to this exact same case 4 years ago in which you and I
> both endorsed the position you are now claiming is so unreasonable
> that nobody will mind if we change it in a minor release.
> https://www.postgresql.org/message-id/flat/CAKOSWNmwCH0wx6MApc1A8ww%2B%2BEQmG07AZ3t6w_XjRrV1xeZpTA%4...

What I complained about in that thread was mainly that that
patch was simultaneously trying to get stricter (throw error for
year zero) and laxer (parse negative years as BC).

Also, we did not in that thread have the information that Oracle
treats negative years as BC.  Now that we do, the situation is
different, and I'm willing to change my mind about it.  Admittedly,
Oracle seems to require an "S" in the format to parse a leading
dash as meaning a negative year.  But given that our code is willing
to read the case as a negative year without that, it seems pretty
silly to decide that it should read it as an off-by-one negative
year.

			regards, tom lane





view thread (31+ messages)  latest in thread

Message-ID: <941402.1601505397@sss.pgh.pa.us>
Permalink:  ../941402.1601505397@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/941402.1601505397@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, bruce@momjian.us, david.g.johnston@gmail.com, laurenz.albe@cybertec.at, pgsql-hackers@lists.postgresql.org
  Subject: Re: BUG #16419: wrong parsing BC year in to_date() function
  In-Reply-To: <941402.1601505397@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