Re: Created feature for to_date() conversion using patterns'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'

Поиск
Список
Период
Сортировка
От Cleysson Lima
Тема Re: Created feature for to_date() conversion using patterns'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'
Дата
Msg-id CAEPXaE1n3g2hc4yfsM2VdmUg+LL_KL37e-WF4oYqUk8fG0zhjg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Created feature for to_date() conversion using patterns'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'  (Mark Lorenz <postgres@four-two.de>)
Ответы Re: Created feature for to_date() conversion using patterns 'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Em sex., 10 de jan. de 2020 às 09:22, Mark Lorenz <postgres@four-two.de> escreveu:
Updated the chg_to_date_yyyywwd.patch with additional tests (because it
works not only for 'D' pattern but also for all day patterns like 'Day'
or 'DY'). Added the necessary documentation change.

(The fix_to_char_yyyywwd.patch from
f4e740a8de3ad1e762a28f6ff253ea4f%40four-two.de is still up-to-date)


The following review has been posted through the commitfest application:
make installcheck-world:  tested, passed
Implements feature:       tested, passed
Spec compliant:           tested, passed
Documentation:            not tested

Hi Mark,

this is a review of the patch: chg_to_date_yyyywwd.patch

There hasn't been any problem, at least that I've been able to find.

This one applies cleanly.

The entire compilation went without error as well.

############# Without patch #############

postgres=# SELECT to_date('2019-1-1', 'YYYY-WW-D');
  to_date  
------------
 2019-01-01
(1 row)

postgres=# SELECT to_date('2019-1-2', 'YYYY-WW-D');
  to_date  
------------
 2019-01-01
(1 row)

postgres=# SELECT to_date('2019-1-9', 'YYYY-WW-D');
  to_date  
------------
 2019-01-01
(1 row)


############# With patch #############

postgres=# SELECT to_date('2019-1-1', 'YYYY-WW-D');
  to_date  
------------
 2018-12-30
(1 row)

postgres=# SELECT to_date('2019-1-2', 'YYYY-WW-D');
  to_date  
------------
 2018-12-31
(1 row)

postgres=# SELECT to_date('2019-1-9', 'YYYY-WW-D');
  to_date  
------------
 2019-01-07
(1 row)

+1 for committer review

--
Cleysson Lima

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PATCH: Fix wrong size argument to pg_strncasecmp
Следующее
От: Alexey Kondratov
Дата:
Сообщение: Re: [Patch] pg_rewind: options to use restore_command fromrecovery.conf or command line