to_char incompatibility - Mailing list pgsql-hackers

From Peter Eisentraut
Subject to_char incompatibility
Date
Msg-id 200801101341.18862.peter_e@gmx.net
Whole thread Raw
List pgsql-hackers
On Oracle:

SQL> select to_date('31-DEC-200700:00:00', 'dd-mon-yyyy hh24:mi:ss') from 
dual;

TO_DATE('
---------
31-DEC-07

On PostgreSQL:

select to_date('31-DEC-200700:00:00', 'dd-mon-yyyy hh24:mi:ss');  to_date
--------------200700-12-31

Now the input value is probably a mistake.  But according to the theory 
described in the PostgreSQL documentation that to_char more or less ignores 
whitespace unless FX is used, I think the Oracle behavior is more correct. In 
addition, even if it wants to take 6 digits for the year in spite of only 4 
Y's, the rest of the format wouldn't match anymore.

Is anyone an Oracle format code expert who can comment on this?

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


pgsql-hackers by date:

Previous
From: Markus Schiltknecht
Date:
Subject: Re: Some ideas about Vacuum
Next
From: "Roberts, Jon"
Date:
Subject: Re: to_char incompatibility