Re: WIP: RangeTypes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WIP: RangeTypes
Date
Msg-id 21519.1296425690@sss.pgh.pa.us
Whole thread Raw
In response to Re: WIP: RangeTypes  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: WIP: RangeTypes  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> On Sun, 2011-01-30 at 02:55 +0000, Thom Brown wrote:
>> postgres=# select '[18,20]'::numrange @> 19;
>> ERROR:  operator does not exist: numrange @> integer
>> LINE 1: select '[18,20]'::numrange @> 19;
>> ^
>> HINT:  No operator matches the given name and argument type(s). You
>> might need to add explicit type casts.

> It's because it doesn't know the type on the right side, and assumes
> it's an int4.

Well, yeah, it is an int4.  The question ought to be phrased "why does
the parser fail to promote the int4 to numeric?".  There might be some
excuse for an "operator is not unique" here, but I don't understand the
above failure --- it should be able to use an implicit coercion from
int4 to numeric.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: WIP: RangeTypes
Next
From: Robert Haas
Date:
Subject: Re: keeping a timestamp of the last stats reset (for a db, table and function)