Re: Comparing fixed precision to floating (no anwer) - Mailing list pgsql-general

From Johann Zuschlag
Subject Re: Comparing fixed precision to floating (no anwer)
Date
Msg-id E15ZeqI-0008JW-00@mrelay01.kundenserver.de
Whole thread Raw
In response to Comparing fixed precision to floating  (Mike Finn <mike.finn@tacticalExecutive.com>)
List pgsql-general
On Tue, 21 Aug 2001 15:41:22 -0600, Mike Finn wrote:

>I am using numeric(p,s) fields in a database schema.
>Using queries that contain a comparison like
>
>    ...
>    where numericField = 456.789
>    ....
>
>will generate an error
>
>   Unable to identify an operator '=' for types 'numeric' and 'float8'
>   You will have to retype this query using an explicit cast

I have the same problem but nobody seems to understand
that you can't always change the query like in my case,
where a comercial app. sends the query.
I tried the following with no avail.

create function numeric_eq(numeric,float8)
returns bool
as ''
language 'internal';

create operator = (
leftarg=numeric,
rightarg=float8,
procedure=numeric_eq,
commutator='=',
negator='<>',
restrict=eqsel,
join=eqjoinsel
);

The Problem is: It doesn't work and the backend process crashes and get's restarted.
I tried it with 7.03 and I guess 7.1.3 behaves the same.

Do you have any ideas? I agree, that should work in postresql.

regards

Johann

Johann Zuschlag
zuschlag@online.de



pgsql-general by date:

Previous
From: Pete Leonard
Date:
Subject: Error reporting when hitting shared memory limits -
Next
From: Peter Pilsl
Date:
Subject: current_timestamp wrong