Re: Bug in to_timestamp(). - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Bug in to_timestamp().
Date
Msg-id CA+Tgmoa65k+PQNNAu717DdjaA9-uGMWt=ov0NUWmUXggZRRY3A@mail.gmail.com
Whole thread Raw
In response to Re: Bug in to_timestamp().  (Steve Crawford <scrawford@pinpointresearch.com>)
Responses Re: Bug in to_timestamp().  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Bug in to_timestamp().  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
List pgsql-hackers
On Fri, Jun 24, 2016 at 12:26 PM, Steve Crawford
<scrawford@pinpointresearch.com> wrote:
> My observation has been that the PostgreSQL development group aims for
> correctness and the elimination of surprising results. This was part of the
> reason to eliminate a number of automatic casts to dates in earlier
> versions.
>
> To me, 2016-02-30 is an invalid date that should generate an error.
> Automatically and silently changing it to be 2016-03-01 strikes me as a
> behavior I'd expect from a certain other open-source database, not
> PostgreSQL.

I don't particularly disagree with that, but on the other hand, as
mentioned earlier, to_timestamp() is here for Oracle compatibility,
and if it doesn't do what Oracle's function does, then (1) it's not
useful for people migrating from Oracle and (2) we're making up the
behavior out of whole cloth.  I think things that we invent ourselves
should reject stuff like this, but in a compatibility function we
might want to, say, have compatibility.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Postgres_fdw join pushdown - wrong results with whole-row reference
Next
From: Peter Geoghegan
Date:
Subject: Re: tuplesort.c's copytup_index() is dead code