Date_part & cast. - Mailing list pgsql-sql

From Benoit Brodard
Subject Date_part & cast.
Date
Msg-id 39000669.7F87401@cyberdeck.net
Whole thread Raw
Responses Re: Date_part & cast.  (Christopher Sawtell <csawtell@xtra.co.nz>)
List pgsql-sql
Hi,

We use PostgreSQL 6.5.3 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3, and we get the following results with date_part
:

db=> select date_part( 'dow', date '20000421' );
date_part
---------       5
(1 row)

db=> select date_part( 'dow', date ( '20000421' ) );
date_part
---------       6
(1 row)

Is this correct ? If yes, I could not find any explanation for the second result which also differ from "select
date_part('dow', date (20000421)  );"
 

Thanks for any help,

-Benoit Brodard.





pgsql-sql by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: RE: TOAST (was: BLOB)
Next
From: "Sondaar, Roelof"
Date:
Subject: RE: Threaded Records in SQL: Advice Needed