Re: to_date() and invalid dates - Mailing list pgsql-general

From Albe Laurenz
Subject Re: to_date() and invalid dates
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17C916E4@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to Re: to_date() and invalid dates  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-general
Thomas Kellerer wrote:
>>> I asked this a while back already:
>>>
>>>    select to_date('2013-02-31', 'yyyy-mm-dd');
>>>
>>> will not generate an error (unlike e.g. Oracle)
>>
>> This is by design.
> 
> When I previously asked this question the answer as "this is based on Oracle's to_date()":
> http://postgresql.1045698.n5.nabble.com/to-char-accepting-invalid-dates-td4598597.html#a4608551

See for example
http://www.postgresql.org/message-id/20099.1350484290@sss.pgh.pa.us
that this is known and accepted behaviour.
However,
http://www.postgresql.org/message-id/22259.1114613632@sss.pgh.pa.us
so I guess that it was not intended, but since it has been that way
for long enough it would be too painful to change it.

So actually my original answer "it is by design" is probably wrong.

"Based upon" should be read as "inspired by" rather than
"compatible with".

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Correct query to check streaming replication lag
Next
From: Stefan Warten
Date:
Subject: pg_upgrade fails: "Mismatch of relation OID in database" - 9.2.4 to 9.3.2