TO_DATE behavior!

From: "Gevik Babakhani" <pgdev(at)xs4all(dot)nl>
To: "'pgsql-hackers'" <pgsql-hackers(at)postgresql(dot)org>
Subject: TO_DATE behavior!
Date: 2008-02-21 10:17:36
Message-ID: 008801c87472$fb72d600$0a01a8c0@gevmus
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I would like to have your opinion about the following behavior of TO_DATE.
Is this correct or a hidden feature?

case:
'mon 21-feb-2008' is obviously a bad date. It should be 'thu 21-feb-2008'

test:
testdb=# select to_date('mon 21-feb-2008','dy dd-mon-yyyy');
to_date
------------
2008-02-21
(1 row)

No complains there!(?)

The opposite query results the correct date.

test:
testdb=# select to_char(to_date('mon 21-feb-2008','dy dd-mon-yyyy'),'dy
dd-mon-yyyy');
to_char
-----------------
thu 21-feb-2008
(1 row)

Regards,
Gevik

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2008-02-21 10:35:15 Re: TO_DATE behavior!
Previous Message Magnus Hagander 2008-02-21 09:33:03 Re: Permanent settings