Skip site navigation (1) Skip section navigation (2)

Re: WIP: RangeTypes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: WIP: RangeTypes
Date: 2011-01-30 22:14:50
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Jeff Davis <pgsql(at)j-davis(dot)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

In response to


pgsql-hackers by date

Next:From: Robert HaasDate: 2011-01-30 22:22:50
Subject: Re: keeping a timestamp of the last stats reset (for a db, table and function)
Previous:From: Robert HaasDate: 2011-01-30 22:12:35
Subject: Re: log_hostname and pg_stat_activity

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group