Skip site navigation (1) Skip section navigation (2)

Re: BUG #3624: EXTRACT(QUARTER FROM INTERVAL) always returns 1

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Cc: "Eugene M(dot) Hutorny" <eugene(at)ksf(dot)kiev(dot)ua>
Subject: Re: BUG #3624: EXTRACT(QUARTER FROM INTERVAL) always returns 1
Date: 2007-09-21 14:57:46
Message-ID: 200709211657.46608.peter_e@gmx.net (view raw or flat)
Thread:
Lists: 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/

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2007-09-21 16:21:44
Subject: Re: BUG #3624: EXTRACT(QUARTER FROM INTERVAL) always returns 1
Previous:From: Brian BarlowDate: 2007-09-21 14:47:03
Subject: BUG #3625: pg_dump with -Ft (tar) option

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group