Re: Bug in to_timestamp().

From: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: Alex Ignatov <a(dot)ignatov(at)postgrespro(dot)ru>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, Tom Lane *EXTERN* <tgl(at)sss(dot)pgh(dot)pa(dot)us>, amul sul <sul_amul(at)yahoo(dot)co(dot)in>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in to_timestamp().
Date: 2016-06-24 22:12:05
Message-ID: a434ef31-6641-c9f1-60c6-8c042a994898@archidevsys.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 25/06/16 08:33, Robert Haas wrote:
> On Fri, Jun 24, 2016 at 12:26 PM, Steve Crawford
> <scrawford(at)pinpointresearch(dot)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.
>
How about a to_timestamp_strict(), in addition?

Its very existence will help people (who bother to read the
documentation) to look more closely at the differences between the
definitions, and allow them to choose the most appropriate for their use
case.

Cheers,
Gavin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Zhidenkov 2016-06-24 22:41:07 Memory leak in Pl/Python
Previous Message Peter Geoghegan 2016-06-24 21:26:18 Re: tuplesort.c's copytup_index() is dead code