pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Fetter <david@fetter.org>
To: Erik Rijkers <er@xs4all.nl>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Subject: Re: Parse CE and BCE in dates and times
Date: Mon, 13 Jun 2022 14:39:52 +0000
Message-ID: <20220613143951.GD12494@fetter.org> (raw)
In-Reply-To: <07c4a60d-d7b9-146b-9d10-faa0b09fd2ee@xs4all.nl>
References: <20220613055136.GB12494@fetter.org>
	<07c4a60d-d7b9-146b-9d10-faa0b09fd2ee@xs4all.nl>

On Mon, Jun 13, 2022 at 09:11:56AM +0200, Erik Rijkers wrote:
> Op 13-06-2022 om 07:51 schreef David Fetter:
> > Folks,
> > 
> > Please find attached a patch to do $Subject. As dates in a fair number
> > of fields of endeavor are expressed this way, it seems reasonable to
> > ensure tha we can parse them on input. Making it possible to use them
> > in output is a more invasive patch, and would involve changes to
> > to_date and similar that would require careful consideration.
> 
> Hi David,
> 
> I find some unexpected results:
> 
> # select '112-04-30 BC'::date;
>      date
> ---------------
>  0112-04-30 BC
> (1 row)
> 
> but the same with the ' BCE' suffix seems broken:
> 
> # select '112-04-30 BCE'::date;
> ERROR:  invalid input syntax for type date: "112-04-30 BCE"
> LINE 1: select '112-04-30 BCE'::date;
> 
> The same goes for '112-04-30 AD' (works) and its CE version (errors out).
> 
> Or is this as expected?

It's not, and thanks for looking at this.  Will check to see what's
going on here.

Best,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate





view thread (4+ messages)  latest in thread

Message-ID: <20220613143951.GD12494@fetter.org>
Permalink:  ../20220613143951.GD12494@fetter.org/
Also on:    postgresql.org/message-id/20220613143951.GD12494@fetter.org

 · 

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-hackers@postgresql.org
  Cc: david@fetter.org, er@xs4all.nl
  Subject: Re: Parse CE and BCE in dates and times
  In-Reply-To: <20220613143951.GD12494@fetter.org>

* 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