It appears to function properly in 7.0 Beta 2:

philtst=# select version();
                             version                              
------------------------------------------------------------------
 PostgreSQL 7.0.0 on sparc-sun-solaris2.7, compiled by gcc 2.95.2
(1 row)

philtst=# SELECT date_part('day','03-26-2000'::date);
 date_part 
-----------
        26
(1 row)

philtst=# SELECT date_part('day','03-26-2000'::datetime);
 date_part 
-----------
        26
(1 row)

philtst=# 

Phil Culberson
DAT Services

-----Original Message-----
From: Stefan Loidl [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 29, 2000 3:54 AM
To: [EMAIL PROTECTED]
Subject: [GENERAL] Bug in date_part() ?



Hi,

I'm currently using postgres 6.4.2 on Sun Solaris.
There seems to be a strange bug in the date_part() function.
See below:

accounting=> SELECT date_part('day','03-26-2000'::date);
date_part
---------
       25
(1 row)

Whereas it works with a cast to datetime:

accounting=> SELECT date_part('day','03-26-2000'::datetime);
date_part
---------
       26
(1 row)

For other dates both versions have the same correct result.

Can somebody check if this bug also occurs in 6.5.3 or 7.0beta?

Greetings,
Stefan

-- 
Stefan Loidl                    Phone:  +49 89 289-28882
Leibniz-Rechenzentrum           Fax:    +49 89 2809460
Barer Str. 21                   mailto:[EMAIL PROTECTED]
80333 Munich, Germany           http://www.lrz.de

Reply via email to