Re: [GENERAL] to_timestamp() and quarters

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] to_timestamp() and quarters
Дата
Msg-id 11420.1267636098@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] to_timestamp() and quarters  (Brendan Jurd <direvus@gmail.com>)
Ответы Re: [GENERAL] to_timestamp() and quartersf  (Bruce Momjian <bruce@momjian.us>)
Re: [GENERAL] to_timestamp() and quarters  (Brendan Jurd <direvus@gmail.com>)
Список pgsql-hackers
Brendan Jurd <direvus@gmail.com> writes:
> For example, you're trying to import a date that is written as "Wed
> 3rd March, Q1 2010".  You might give to_date a format string like 'Dy
> FMDDTH Month, "Q"Q YYYY' and expect to get the correct answer.  If we
> start throwing an error on the Q field, then users would have to
> resort to some strange circumlocution to get around it.

Hmm.  That's an interesting test case: if Q throws an error, there
doesn't seem to be any way to do it at all, because there is no format
spec for ignoring non-constant text.  Conversely, Bruce's proposed
patch would actually break it, because the Q code would overwrite the
(correct) month information with the first-month-of-the-quarter.

So at the moment my vote is "leave it alone".  If we want to throw
error for Q then we should provide a substitute method of ignoring
a field.  But we could just document Q as ignoring an integer for
input.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] to_timestamp() and quarters
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] to_timestamp() and quartersf