Re: Dates in inserts

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Dates in inserts
Дата
Msg-id 961.1049211765@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Dates in inserts  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
Ответы Re: Dates in inserts  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-general
"Nigel J. Andrews" <nandrews@investsystems.co.uk> writes:
> Probably becuase there is no 13th month so 01.13.03 can only be
> interpreted as the 13th of January.

Right, and the same goes for 13.01.03: even if your datestyle is mmddyy,
the date parser will take this as ddmmyy, because otherwise it couldn't
be valid.  AFAIK there is no way to force the date parser to reject the
input instead.  Datestyle is used to drive the interpretation when the
input is ambiguous, but not when there is only one interpretation that
will work.

If you prefer to be stiff-necked then I'd recommend putting some
validation on the client side.

            regards, tom lane


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: stored procedure
Следующее
От: "Peter Schueller"
Дата:
Сообщение: deferred constraint trigger problem