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

Unable to identify an operator '=' for types 'numeric' and 'float8'

From: Sridhar Bhamidi <sridhar(at)pramati(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Unable to identify an operator '=' for types 'numeric' and 'float8'
Date: 2002-03-14 08:12:39
Message-ID: 3C905B77.2010806@pramati.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Hi
I am using PostgreSQL version 7.1.2
 and the problem that I am facing can be reproduced as below

create table numeric_tab (col1 numeric(20)) ;
CREATE
insert into numeric_tab values(123456789012345) ;
INSERT 222295 1
select col1 from numeric_tab where col1 = 123456789012345 ;
ERROR:  Unable to identify an operator '=' for types 'numeric' and 'float8'
    You will have to retype this query using an explicit cast

What I noticed is that if the value entered in the where clause is > 
2147483647
(value of a signed int4) this error message is thrown.
This problem does not occur with a bigint type

create table bigint_tab(col1 bigint) ;
CREATE
insert into bigint_tab values (123456789012345) ;
INSERT 222306 1
select col1 from bigint_tab where col1 = 123456789012345 ;
      col1      
-----------------
 123456789012345
(1 row)

My point is that if it works for a bigint type, then why not for a 
numeric type.
I am currently using this as a workaround, but I would prefer a numeric 
type.

This problem also occurs on the 7.2 version of postgres, only the 
message is slightly
different

ERROR:  Unable to identify an operator '=' for types 'numeric' and 
'double precision'
    You will have to retype this query using an explicit cast

I won't be able to cast the query because I am getting this as a 
generated query
from an Application Server.

I have seen this problem on the archives of  Postgres, but could not 
locate any
answer or a pointer on when this would be fixed.

Thanks
-Sridhar


pgsql-bugs by date

Next:From: pgsql-bugsDate: 2002-03-14 11:15:19
Subject: Bug #614: Incorrect parse with time function
Previous:From: Peter EisentrautDate: 2002-03-14 05:53:20
Subject: Re: sequence havn't been dropped.

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