Re: Output of date_part('quarter', date) - Mailing list pgsql-bugs

From Karel Zak
Subject Re: Output of date_part('quarter', date)
Date
Msg-id Pine.LNX.3.96.1010104090126.14878A-100000@ara.zf.jcu.cz
Whole thread Raw
In response to Output of date_part('quarter', date)  ("Denis V. Osadchy" <osadchy@turbo.nsk.su>)
List pgsql-bugs
> I tried to use function date_part('quarter', date) in query and I have
> got wrong results - for first quarter I've got all rows from 01.01 to
> 31.03
> for second - from from 01.04 to 31.07 (!!!)
> for third  - from from 01.08 to 30.11 (!!!)
> for forth  - from from 01.12 to 31.12 (!!!)
> -----------------------
> PostgreSQL 7.0.2 on i386-pc-bsdi4.0.1, compiled by gcc 2.7.2.1
> -----------------------

 until bug will fix, in 7.0.2 you can use:

    ... WHERE to_char(field, 'YYYY Q') = '2000 1'

 (it's - may be - faster than 2x date_part())

            Karel

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: dump of functions does not handle backslashes correctly
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: subselects doesn't work in v7.0.3