Overwriting Operator for numeric and float8 fails - Mailing list pgsql-general

From Johann Zuschlag
Subject Overwriting Operator for numeric and float8 fails
Date
Msg-id E15YNrA-0008AE-00@mrelay00.kundenserver.de
Whole thread Raw
Responses Re: Overwriting Operator for numeric and float8 fails
Re: Overwriting Operator for numeric and float8 fails
List pgsql-general
Hi,

My application does queries like this:

SELECT t6.* FROM RECHNUNG  t6 WHERE t6.bruttosumm = 00000034.70 ORDER BY t6.nummer DESC

I get the following error: Unable to identify an operator '=' for types 'numeric' and 'float8'...
and of course the same for the operator '<>'.
Ok, ok quotes missing.

Before I just let the ODBC-driver patch the quotes. Not so smart.
Now I tried the smarter way by overwriting the operator:

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.
What am I doing wrong? Can somebody give me a hint?

Thanks in advance



Johann Zuschlag
zuschlag@online.de



pgsql-general by date:

Previous
From: Stephen Robert Norris
Date:
Subject: Re: Serial not so unique?
Next
From: Andrew Gould
Date:
Subject: Re: Overwriting Operator for numeric and float8 fails