Re: help: now() + N is now failing! - Mailing list pgsql-novice

From Tom Lane
Subject Re: help: now() + N is now failing!
Date
Msg-id 22708.1059495424@sss.pgh.pa.us
Whole thread Raw
In response to Re: help: now() + N is now failing!  (Dmitry Tkach <dmitry@openratings.com>)
Responses Re: help: now() + N is now failing!
List pgsql-novice
Dmitry Tkach <dmitry@openratings.com> writes:
> But in cases like date_pli (now(), 2) - there is only one alternative,
> thus no ambiguity - why not just do it?

No, there are zero alternatives.  And we're actually moving slowly on
this issue to make the transition less painful for people.  If I had my
druthers 7.3 would have been much more draconian about implicit casts.
For an example of surprising behavior that is still there, reflect on
this open bug report:
http://archives.postgresql.org/pgsql-bugs/2001-10/msg00103.php
http://archives.postgresql.org/pgsql-bugs/2001-10/msg00108.php
The details have changed since 7.1, but we still end up comparing the
values as if they were text strings; and there is no way to avoid this
except to stop treating casts to text as implicitly invocable.

            regards, tom lane

pgsql-novice by date:

Previous
From: Godshall Michael
Date:
Subject: switch statement in plpgsql
Next
From: Stephan Szabo
Date:
Subject: Re: help: now() + N is now failing!