Re: BUG #3624: EXTRACT(QUARTER FROM INTERVAL) always returns 1 - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: BUG #3624: EXTRACT(QUARTER FROM INTERVAL) always returns 1
Date
Msg-id 200709211657.46608.peter_e@gmx.net
Whole thread Raw
In response to BUG #3624: EXTRACT(QUARTER FROM INTERVAL) always returns 1  ("Eugene M. Hutorny" <eugene@ksf.kiev.ua>)
List pgsql-bugs
Am Freitag, 21. September 2007 schrieb Eugene M. Hutorny:
> SQL statemet
> SELECT EXTRACT(QUARTER FROM INTERVAL '1 day');
>
> Returns: 1
> Expected: 0
>       Or: ERROR: interval units "quarter" not supported

An alternative behavior would be to return something like

 ceil($argument / (360/4))

or however one would calculate the quarter exactly.

The current behavior makes no sense to me either.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

pgsql-bugs by date:

Previous
From: "Brian Barlow"
Date:
Subject: BUG #3625: pg_dump with -Ft (tar) option
Next
From: Tom Lane
Date:
Subject: Re: BUG #3624: EXTRACT(QUARTER FROM INTERVAL) always returns 1