Re: Postgresql likes Tuesday... - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Postgresql likes Tuesday...
Date
Msg-id 1033418798.2751.8.camel@rh72.home.ee
Whole thread Raw
In response to Re: Postgresql likes Tuesday...  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Postgresql likes Tuesday...  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: (Fwd) Re: Any Oracle 9 users? A test please...
Next
From: Tom Lane
Date:
Subject: Re: Postgresql likes Tuesday...