Re: AW: Re: Week number

From: Roland Roberts <roland(at)astrofoto(dot)org>
To: Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: AW: Re: Week number
Date: 2001-03-14 18:23:30
Message-ID: m28zm8gqfx.fsf@tycho.rlent.pnet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "AZ" == Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at> writes:

>> 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".

AZ> Germany and Austria have Monday as first day of week, I think
AZ> most of Europe also.

I believe the goal was to have a to_char() that was complete and
Oracle-compatible. Perhaps we need to also have a trunc() which is
Oracle compatible. I haven't been playing with 7.1beta, but 7.0
trunc() doesn't like timestamps. In Oracle, I can say

select trunc(sysdate) - trunc(sysdate,'ww') + 1 from dual;

to get Monday=1.

roland
--
PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD RL Enterprises
roland(at)rlenter(dot)com 76-15 113th Street, Apt 3B
rbroberts(at)acm(dot)org Forest Hills, NY 11375

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-03-14 18:27:11 Re: pgmonitor patch for query string
Previous Message Bruce Momjian 2001-03-14 18:16:06 Re: pgmonitor patch for query string