Re: to_char() accepting invalid dates?

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: to_char() accepting invalid dates?
Date: 2011-07-20 07:15:15
Message-ID: j05v9d$v85$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bruce Momjian, 20.07.2011 03:03:
>>> Well, to_char() is based on Oracle's to_char(). How does Oracle handle
>>> such a date?
>>
>> Oracle throws an error for the above example:
>>
>> SQL> select to_date('20110231', 'YYYYMMDD') from dual;
>> select to_date('20110231', 'YYYYMMDD') from dual
>> *
>> ERROR at line 1:
>> ORA-01839: date not valid for month specified
>>
>> SQL>
>
> OK, it's a bug then. Let me see if I can find a fix for it.

Thanks for the info. I didn't know it was modelled after the Oracle implementation.

Regards
Thomas

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Sofer, Yuval 2011-07-20 10:55:59 compile postgres with visual studio 2010
Previous Message Bruce Momjian 2011-07-20 01:03:44 Re: to_char() accepting invalid dates?