Re: [SQL] to_char() accepting invalid dates?

2011-07-18 Thread Bruce Momjian
Thomas Kellerer wrote: > Jasen Betts wrote on 18.07.2011 11:23: > >> postgres=> select to_date('20110231', 'mmdd'); > >> > >> to_date > >> > >>2011-03-03 > >> (1 row) > >> > >> is there a way to have to_date() raise an exception in such a case? > > > > it's possible the od

Re: [SQL] to_char() accepting invalid dates?

2011-07-18 Thread Thomas Kellerer
Jasen Betts wrote on 18.07.2011 11:23: postgres=> select to_date('20110231', 'mmdd'); to_date 2011-03-03 (1 row) is there a way to have to_date() raise an exception in such a case? it's possible the odd behaviour you get is required by some standard. That would be *

Re: [SQL] to_char() accepting invalid dates?

2011-07-18 Thread Jasen Betts
On 2011-07-18, Thomas Kellerer wrote: > 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', 'mmdd'); > >to_date > > 2011-03-03 > (1 row) > > is there a way to have to

[SQL] to_char() accepting invalid dates?

2011-07-18 Thread Thomas Kellerer
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', 'mmdd'); to_date 2011-03-03 (1 row) is there a way to have to_date() raise an exception in such a case? Regards Thomas --