Re: Parse CE and BCE in dates and times

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: Parse CE and BCE in dates and times
Дата
Msg-id 20220613143951.GD12494@fetter.org
обсуждение исходный текст
Ответ на Re: Parse CE and BCE in dates and times  (Erik Rijkers <er@xs4all.nl>)
Ответы Re: Parse CE and BCE in dates and times  (Jacob Champion <jchampion@timescale.com>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Skipping logical replication transactions on subscriber side
Следующее
От: Sergey Dudoladov
Дата:
Сообщение: Re: Add connection active, idle time to pg_stat_activity