Re: Rectifying wrong Date outputs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Rectifying wrong Date outputs
Дата
Msg-id 20387.1300715877@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Rectifying wrong Date outputs  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Rectifying wrong Date outputs  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Mar 21, 2011 at 6:24 AM, Heikki Linnakangas
> <heikki.linnakangas@enterprisedb.com> wrote:
>>> Having said that, it's not entirely clear to me what sane behavior is
>>> here. �Personally I would expect that an n-Ys format spec would consume
>>> at most n digits from the input. �Otherwise how are you going to use
>>> to_date to pick apart strings that don't have any separators?

>> Yeah, seems reasonable.

> On the flip side, what if you want to allow either a two digit year or
> a four digit year?  It doesn't seem unreasonable to allow YY to
> emcompass what YYYY would have allowed, unless there's a separate
> notion for 'either YY or YYYY'.

What I was thinking was that YYYY would take either 2 or 4 digits.
Whatever you do here, the year will have to be delimited by a non-digit
for such cases to be parseable.

> I'm OK with that, but again, exactly what rule is Oracle applying here?

Yeah.  Hopefully they documented it, and we don't have to try to
reverse-engineer the intention from an undersized set of samples.
        regards, tom lane


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Rectifying wrong Date outputs
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Rectifying wrong Date outputs