Re: Parse CE and BCE in dates and times

From: Erik Rijkers <er(at)xs4all(dot)nl>
To: David Fetter <david(at)fetter(dot)org>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parse CE and BCE in dates and times
Date: 2022-06-13 07:11:56
Message-ID: 07c4a60d-d7b9-146b-9d10-faa0b09fd2ee@xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

Erik Rijkers

>
> Best,
> David.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message houzj.fnst@fujitsu.com 2022-06-13 07:33:18 RE: Replica Identity check of partition table on subscriber
Previous Message David Fetter 2022-06-13 07:03:27 Re: Finer grain log timestamps