Re: BUG #1094: date_part('week') bug - Mailing list pgsql-bugs

From Bruno Wolff III
Subject Re: BUG #1094: date_part('week') bug
Date
Msg-id 20040304181231.GA22156@wolff.to
Whole thread Raw
In response to BUG #1094: date_part('week') bug  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
List pgsql-bugs
On Thu, Mar 04, 2004 at 13:56:42 -0400,
  PostgreSQL Bugs List <pgsql-bugs@postgresql.org> wrote:
>
> The following bug has been logged online:

This isn't a bug. Weeks that span years are treated as part of the year
in which Thursday of that week lies.

>
> Bug reference:      1094
> Logged by:          xterm
>
> Email address:      xterm@linuxnews.pl
>
> PostgreSQL version: 7.3.4
>
> Operating system:   RH Fedora
>
> Description:        date_part('week') bug
>
> Details:
>
> Some late dates give in some years wrong
> date_part('week')
>
> examples:
>
> select date_part('week', '2003-12-30'::date);
>  date_part
> -----------
>          1
> (1 row)
>
> select date_part('week', '1997-12-29'::date);
>  date_part
> -----------
>          1
> (1 row)
>
> but:
>
> select date_part('week', '1998-12-31'::date);
>  date_part
> -----------
>         53
> (1 row)
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

pgsql-bugs by date:

Previous
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1094: date_part('week') bug
Next
From: Robert Creager
Date:
Subject: Re: BUG #1094: date_part('week') bug