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

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 (view raw or flat)
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

pgsql-hackers by date

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

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