Re: EXTRACT broken

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: EXTRACT broken
Дата
Msg-id 3BC54034.74AB15E6@fourpalms.org
обсуждение исходный текст
Ответ на EXTRACT broken  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: EXTRACT broken  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
> Just updated...
> peter=# SELECT EXTRACT(DOW FROM TIMESTAMP '2001-02-16 20:38:40');
> ERROR:  Timestamp with time zone units 'dow' not recognized
> This is documented to work.

Ah, I broke this with some recent additions to implement more ISO
conventions (I changed the behavior of the date/time parser so that it
does not willingly ignore unrecognized fields).

I see the problem and the solution, but am in the middle of a few
changes to SET code and can't test at the moment. Hopefully I'll get
this fixed in the next couple of days, and if not I'll get it done early
next week.

Would you like to add some tests to the regression suite? Clearly this
isn't covered there...

> peter=# SELECT EXTRACT(DOW FROM TIME '20:38:40');
> ERROR:  Interval units 'dow' not recognized
> The expression is nonsensical, but so is the result.

Hmm. Why is the result nonsensical? "day of week" does not have meaning
for intervals, so it should not be recognized, right?

It is the same result as saying
 SELECT timestamp_part('yabadabadoo', time '20:38:40');
                      - Thomas


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

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: extract(timezone_hour) funny business
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_dump -C option