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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-bugs by date

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