to_char() accepting invalid dates? - Mailing list pgsql-sql

From Thomas Kellerer
Subject to_char() accepting invalid dates?
Date
Msg-id j00qg6$lvf$1@dough.gmane.org
Whole thread Raw
List pgsql-sql
Hi,

I just noticed that to_char() will "accept" invalid dates such as 2011-02-31 and "adjust" them accordingly:

postgres=> select to_date('20110231', 'yyyymmdd');  to_date
------------ 2011-03-03
(1 row)

is there a way to have to_date() raise an exception in such a case?

Regards
Thomas



pgsql-sql by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Looking for a "show create table " equivalent
Next
From: Jasen Betts
Date:
Subject: Re: to_char() accepting invalid dates?