Re: day of week - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: day of week
Date
Msg-id Pine.LNX.4.21.0006070048130.3158-100000@localhost.localdomain
Whole thread Raw
In response to Re: day of week  (Karel Zak <zakkr@zf.jcu.cz>)
Responses Re: day of week
List pgsql-hackers
Karel Zak writes:

> The Oracle always directly set first week on Jan-01, but day-of-week count
> correct... It is pretty dirty, but it is a probably set in libc's mktime().

The first week of the year is most certainly not (always) the week with
Jan-01 in it. My understanding is that it's the first week where the
Thursday is in the new year, but I might be mistaken. Here in Sweden much
of the calendaring is done based on the week of the year concept, so I'm
pretty sure that there's some sort of standard on this. And sure enough,
this year started on a Saturday, but according to the calendars that hang
around here the first week of the year started on the 3rd of January.


> Well, we will in PG both version:
> 
> oracle's to_char:     
>     * week-start is a sunday 
>     * first week start on Jan-01, but day-of-week is count continual
> 
> PG date_part/trunc:     
>     * week-start in monday
>     * first week is a first full week in new year (really?)  

The worst thing we could do is having an inconsistency here. Having a
configuration option or two that applies to both sounds better.


-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden





pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Protection of debugging options
Next
From: Karel Zak
Date:
Subject: Re: day of week