pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Bryn Llewellyn <bryn@yugabyte.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: to_date() and to_timestamp() with negative years
Date: Wed, 03 Nov 2021 18:23:54 -0400
Message-ID: <265331.1635978234@sss.pgh.pa.us> (raw)
In-Reply-To: <c105f567-aa51-8eee-d272-ef472ca6c9dc@aklaver.com>
References: <A7385FDD-CC12-44DD-BEE8-8E8AD5C69EF5@yugabyte.com>
	<138332.1635962086@sss.pgh.pa.us>
	<08E63AD5-8E6D-4140-AE1C-9DC22324A287@yugabyte.com>
	<72204b8f-41b2-0004-b09b-842f8c57477f@aklaver.com>
	<0B75398B-91CC-4074-B77A-390AA157685B@yugabyte.com>
	<c105f567-aa51-8eee-d272-ef472ca6c9dc@aklaver.com>

Adrian Klaver <adrian.klaver@aklaver.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





view thread (14+ messages)  latest in thread

Message-ID: <265331.1635978234@sss.pgh.pa.us>
Permalink:  ../265331.1635978234@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/265331.1635978234@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, adrian.klaver@aklaver.com, bryn@yugabyte.com
  Subject: Re: to_date() and to_timestamp() with negative years
  In-Reply-To: <265331.1635978234@sss.pgh.pa.us>
  References: <A7385FDD-CC12-44DD-BEE8-8E8AD5C69EF5@yugabyte.com> <138332.1635962086@sss.pgh.pa.us> <08E63AD5-8E6D-4140-AE1C-9DC22324A287@yugabyte.com> <72204b8f-41b2-0004-b09b-842f8c57477f@aklaver.com> <0B75398B-91CC-4074-B77A-390AA157685B@yugabyte.com> <c105f567-aa51-8eee-d272-ef472ca6c9dc@aklaver.com> <265331.1635978234@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