Re: Bug in date arithmetic - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug in date arithmetic
Date
Msg-id 6196.1251145150@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug in date arithmetic  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> I wonder if we could get around this by inventing a new type
> date_or_interval which looks at the input and decides which it is
> using fairly strict rules. date_sub would take that type and do the
> appropriate operation based on what the constant had in it.

Ick.  This would be a pretty enormous blot on the type system to solve
one special case, in a manner that would only be helpful to newbies
who don't know that they ought to cast to eliminate the ambiguity.

In fact it sounds quite a bit like the implicit-cast-to-text situations
we just finished getting rid of ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Feedback about Drupal SQL debugging
Next
From: David Fetter
Date:
Subject: Re: Bug in date arithmetic