Re: [PATH] Correct negative/zero year in to_date/to_timestamp

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [PATH] Correct negative/zero year in to_date/to_timestamp
Дата
Msg-id CA+TgmoZGZZ1+swjEmG42ZrABA6LpZu2ZVKG1=MV-4qX6YYFQ5g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATH] Correct negative/zero year in to_date/to_timestamp  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
Ответы Re: [PATH] Correct negative/zero year in to_date/to_timestamp
Re: [PATH] Correct negative/zero year in to_date/to_timestamp
Список pgsql-hackers
On Sun, Feb 28, 2016 at 9:38 PM, Vitaly Burovoy
<vitaly.burovoy@gmail.com> wrote:
>> However, I'm not sure we ought to tinker with the behavior in this
>> area.  If YYYY-MM-DD is going to accept things that are not of the
>> format YYYY-MM-DD, and I'd argue that -1-06-01 is not in that format,
>
> It is not about format, it is about values.

I disagree.  In a format like "-1-06-01", you want the first minus to
indicate negation and the other two to be a separator.  That's not
very far away from wanting the database to read your mind.

> Because it is inconvenient a little. If one value ("-2345") is passed,
> another one ("2346 BC") is got. In the other case a programmer must
> check for negative value, and if so change a sign and add "BC" to the
> format. Moreover the programmer must keep in mind that it is not
> enough to have usual date format "DD/MM/YYYY", because sometimes there
> can be "BC" part.

Yeah, well, that's life.  You can write an alternative function to
construct dates that works the way you like, and that may well be a
good idea.  But I think *this* change is not a good idea, and
accordingly I vote we reject this patch.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: snapshot too old, configured by time
Следующее
От: Joe Conway
Дата:
Сообщение: Re: dblink: add polymorphic functions.