Re: Using YY-MM-DD date input

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Using YY-MM-DD date input
Дата
Msg-id 12655.1059177306@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Using YY-MM-DD date input  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Using YY-MM-DD date input  (Ron Johnson <ron.l.johnson@cox.net>)
Re: Using YY-MM-DD date input  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-general
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> It would be nice to specify the input and output formats independently.

They are independent now.

> I think we can sort of do that now, but it isn't clear.  When format is
> Postgres, US/European control whether month is first in input and
> output.  When it is ISO, the US/European only controls input for non-ISO
> dates.  It isn't very clear, but does hit the common uses.

Obviously not clear, if you don't understand it ;-).  Here is the
current situation:

* The output part of DateStyle is the ISO/Postgres/SQL/German setting.
  This determines the output format, and nothing else.

* The input part of DateStyle is the US/European setting.  This
  determines the resolution of dd vs mm during input, but only when
  the input is ambiguous --- if the code can infer which is dd and which
  is mm by range, it will do that regardless of DateStyle.

The discussion last month concluded that the heuristic resolution of
dd/mm is dangerous, and that we ought to drop the heuristics in favor
of saying that dd/mm is resolved only on the basis of DateStyle.  That's
okay as far as it goes (I'm not very happy with it, but I understand
that I'm outvoted on that point).  The point I'm trying to make is that
we need to extend input DateStyle so that this approach can apply to all
commonly used two-digit-year formats, or we are going to lose
functionality.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Function index qeustion
Следующее
От: Mike Mascari
Дата:
Сообщение: Re: Wacky query plan, why?