Re: to_date() and to_timestamp() with negative years

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Bryn Llewellyn <bryn(at)yugabyte(dot)com>, pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: to_date() and to_timestamp() with negative years
Date: 2021-11-03 22:23:54
Message-ID: 265331.1635978234@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> writes:
> Haven't had time to work through what the above is actually doing.

I think the first two are explained by 489c9c340:

Also, arrange for the combination of a negative year and an
explicit "BC" marker to cancel out and produce AD. This is how
the negative-century case works, so it seems sane to do likewise.

The last two look like a parsing issue: with no field separator
(nope, the space doesn't count), the code is taking the dash
as a field separator.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bryn Llewellyn 2021-11-03 22:56:00 Re: to_date() and to_timestamp() with negative years
Previous Message Adrian Klaver 2021-11-03 22:14:49 Re: to_date() and to_timestamp() with negative years