Re: AW: Re: Week number - Mailing list pgsql-hackers

From Roland Roberts
Subject Re: AW: Re: Week number
Date
Msg-id m28zm8gqfx.fsf@tycho.rlent.pnet
Whole thread Raw
In response to AW: Re: Week number  (Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>)
Responses Re: AW: Re: Week number  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-hackers
>>>>> "AZ" == Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:
   >> Unix day-of-week starts on Sunday, not Monday, which is what   >> date_trunc('dow',...) returns. Presumably this
ismodeled 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@rlenter.com                     76-15 113th Street, Apt 3B
rbroberts@acm.org                          Forest Hills, NY 11375


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pgmonitor patch for query string
Next
From: Tom Lane
Date:
Subject: Re: pgmonitor patch for query string