Re: Postgresql likes Tuesday...

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Rod Taylor <rbt(at)rbt(dot)ca>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Postgresql likes Tuesday...
Date: 2002-09-30 20:46:38
Message-ID: 1033418798.2751.8.camel@rh72.home.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2002-10-01 at 03:31, Tom Lane wrote:
> Offhand this seems kinda inconsistent to me --- I'd expect
>
> regression=# select extract(week from date '2002-09-30');
> date_part
> -----------
> 40
> (1 row)
>
> to produce 39, not 40, on the grounds that the first day of Week 40
> is tomorrow not today. Alternatively, if today is the first day of
> Week 40 (as EXTRACT(week) seems to think), then ISTM that the to_date
> expression should produce today not tomorrow.
>
> I notice that 2001-12-31 is considered part of the first week of 2002,
> which is also pretty surprising:

There are at least 3 different ways to start week numbering:

1. from first week with any days in current year

2. from first full week in current year

3. from first week with thursday in current year

perhaps more...

I suspect it depends on locale which should be used.

---------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Mascari 2002-09-30 20:53:33 Re: (Fwd) Re: Any Oracle 9 users? A test please...
Previous Message Bruce Momjian 2002-09-30 20:37:55 Re: (Fwd) Re: Any Oracle 9 users? A test please...