Re: Historical dates in Timestamp

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Historical dates in Timestamp
Дата
Msg-id 6253.986402213@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Historical dates in Timestamp  ("Albert REINER" <areiner@tph.tuwien.ac.at>)
Список pgsql-sql
"Albert REINER" <areiner@tph.tuwien.ac.at> writes:
> Is it really reasonable to enforce that the number of years is four
> digits at least?

I believe so.  Without that cue it's pretty difficult for the timestamp
parser even to figure out which field is intended to be the year, let
alone whether you'd like 1900 or 2000 added to a two-digit year value.

For example, with the default datestyle:

regression=# select '12-5-28'::timestamp;       ?column?
------------------------2028-12-05 00:00:00-05
(1 row)

regression=# select '0012-5-28'::timestamp;     ?column?
---------------------0012-05-28 00:00:00
(1 row)
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Strategy for unlocking query
Следующее
От: Tom Lane
Дата:
Сообщение: Re: performance of functions - or rather lack of it