Re: [GENERAL] to_timestamp() and quarters

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: [GENERAL] to_timestamp() and quarters
Дата
Msg-id 20100303055543.GA19135@a-kretschmer.de
обсуждение исходный текст
Ответ на Re: [GENERAL] to_timestamp() and quarters  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: [GENERAL] to_timestamp() and quarters  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Список pgsql-hackers
In response to Bruce Momjian :
> Well, I can easily make it do what you expect, and I don't see many
> error returns in that area of the code, so I just wrote a patch that
> does what you would expect rather than throw an error.

Well, that's great and better than an error, thx.

>     test=> select to_date('2010-7', 'YYYY-Q');
>       to_date
>     ------------
>      2011-07-04
>     (1 row)

Is this per SQL-Spec? I would expect an error for a quarter not in
(1,2,3,4).

But stop, now i see:

test=*# select to_date('2010-02-29', 'YYYY-MM-DD'); to_date
------------2010-03-01
(1 row)

So it is maybe a congruously behavior ;-)


Regards, Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: renameatt() can rename attribute of index, sequence, ...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Instead of trying (and failing) to allow <