| Lists: | pgsql-hackers |
|---|
| From: | David Fetter <david(at)fetter(dot)org> |
|---|---|
| To: | PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Parse CE and BCE in dates and times |
| Date: | 2022-06-13 05:51:37 |
| Message-ID: | 20220613055136.GB12494@fetter.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Lists: | pgsql-hackers |
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.
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
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-Common-Era-for-dates.patch | text/x-diff | 20.3 KB |
| 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: | Whole Thread | Raw Message | Download mbox | Resend email |
| 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.
| From: | David Fetter <david(at)fetter(dot)org> |
|---|---|
| To: | Erik Rijkers <er(at)xs4all(dot)nl> |
| Cc: | PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Parse CE and BCE in dates and times |
| Date: | 2022-06-13 14:39:52 |
| Message-ID: | 20220613143951.GD12494@fetter.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Lists: | pgsql-hackers |
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
| From: | Jacob Champion <jchampion(at)timescale(dot)com> |
|---|---|
| To: | David Fetter <david(at)fetter(dot)org>, Erik Rijkers <er(at)xs4all(dot)nl> |
| Cc: | PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Parse CE and BCE in dates and times |
| Date: | 2022-08-02 18:13:23 |
| Message-ID: | cb8c9f48-3517-de6d-1853-00a95b71469f@timescale.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Lists: | pgsql-hackers |
This entry has been waiting on author input for a while (our current
threshold is roughly two weeks), so I've marked it Returned with
Feedback.
Once you think the patchset is ready for review again, you (or any
interested party) can resurrect the patch entry by visiting
https://commitfest.postgresql.org/38/3682/
and changing the status to "Needs Review", and then changing the
status again to "Move to next CF". (Don't forget the second step;
hopefully we will have streamlined this in the near future!)
Thanks,
--Jacob