Re: Week number

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: Nicolai M?kleby <nicolai(dot)mokleby(at)labmed(dot)uio(dot)no>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Week number
Date: 2001-03-14 14:50:35
Message-ID: 3AAF853B.313B14EE@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> First day in week is Monday in ISO week.
> Thomas, we have ISO week-of-year (IW in to_char or 'week' in date_part),
> but we haven't ISO day-of-week (may be as 'ID' for to_char).
> TODO for 7.2?
> ..but in ISO is 0-6; 0=Mon

I've been ignoring this until now, hoping no one would notice ;)

Unix day-of-week starts on Sunday, not Monday, which is what
date_trunc('dow',...) returns. Presumably this is modeled on the
traditional notion (at least in the US; I suspect this is true in most
European countries at least) of Sunday being "the first day of week".

The implementation predates our support of ISO dates so it was not an
issue then.

date_part() is modeled on Ingres' implementation, but my old Ingres
manual indicates that 'dow' is not one of the options.

Should we change the definition of "dow", or implement another choice,
say "idow"?

Comments?

- Thomas

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-03-14 15:02:10 Re: database died
Previous Message Martin A. Marques 2001-03-14 13:27:47 database died