pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Terry Yapt <pgsql@technovell.com>
To: pgsql-sql@postgresql.org
Subject: Comparing Numeric and Double Precision (float8)..
Date: Mon, 04 Nov 2002 09:11:30 +0100
Message-ID: <3DC62BB2.72FC66C8@technovell.com> (raw)

Hello all,

i DON'T know what is the proper forum to throw this question and I must
to insist in this "feature".  Sorry.

I have a lot of tables from Oracle 8i Databases with a lot of columns
with numeric(x,0) definition.

Ok.. I am traslating my oracle tables to PostgreSQL tables.  But I am
having a serious problem with my client aplications.

When I compare a numeric(x,0) field with a float8 field I have an error
on PostgreSQL what I didn't have with Oracle.  I mean:

CREATE test (one numeric(2,0));

SELECT * FROM test WHERE one = 1.00000; 

This runs fine on my Oracle Systems.. but I have problems with my
PostgreSQL system.  I have tried to create an operator to workaround
this inconvenience:

numeric '=' float8
     with CREATE OPERATOR command and calling to a function to return a
boolean.

Ok.. great.. It is running now.  But when it runs.. I have another
problems comparing numeric with integers and so on.  So I must to DROP
OPERATOR......

I don't understand what is the problem and what options I have to
workaround it (without re-write a lot of client applications).

I have a lot of code I don't want to modify.  The question is:

Why we cannot compare numeric with double precision ?  And why Oracle or
SQL can do it without problems ?

Thanks a lot.



view thread (3+ messages)  latest in thread

Message-ID: <3DC62BB2.72FC66C8@technovell.com>
Permalink:  ../3DC62BB2.72FC66C8@technovell.com/
Also on:    postgresql.org/message-id/3DC62BB2.72FC66C8@technovell.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pgsql@technovell.com
  Subject: Re: Comparing Numeric and Double Precision (float8)..
  In-Reply-To: <3DC62BB2.72FC66C8@technovell.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox