Re: day of week - Mailing list pgsql-hackers

From Don Baccus
Subject Re: day of week
Date
Msg-id 3.0.1.32.20000605140346.010600a0@mail.pacifier.com
Whole thread Raw
In response to day of week  (Karel Zak <zakkr@zf.jcu.cz>)
Responses Re: day of week
Re: day of week
List pgsql-hackers
At 10:52 PM 6/5/00 +0200, Karel Zak wrote:
>
>
>We have for same questions different answers now:
>
>(DAY OF WEEK)
>
>test=# select date_part('dow', now());
> date_part
>-----------
>         1
>(1 row)
>
>test=# select to_char(now(), 'D');
> to_char
>---------
> 2
>(1 row)
>
>
>For to_char() I use POSIX definition of 'tm' where week start on Sunday.
> 
>Is it right? (Exuse me, I see archive, but without some effect...).
>
>Or we will support both styles?

to_char() gives the same answer with Oracle, as it is supposed to
and as you intended it to.

I personally don't find it all that disconcerting that the two give
different answers.  Change the old, PG way and lots of old code
is likely to break.  Change to_char() and the desired compatibility
with Oracle breaks.

I think it boils down to needing good documentation ???



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: Re: [v7.0.2] Very small cleanup release ...
Next
From: Karel Zak
Date:
Subject: Re: day of week