Re: day of week

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>, pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: day of week
Date: 2000-06-05 21:03:46
Message-ID: 3.0.1.32.20000605140346.010600a0@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak 2000-06-05 21:34:29 Re: day of week
Previous Message Karel Zak 2000-06-05 20:52:51 day of week