Re: Comparing different numeric data types

From: Andrew Sullivan <andrew(at)libertyrms(dot)info>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Comparing different numeric data types
Date: 2003-02-03 15:43:48
Message-ID: 20030203104348.E17659@mail.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jan 31, 2003 at 01:21:54PM +0100, Vicente Alabau Gonzalvo wrote:
> I don't know if it's the right place for posting this thing.
> Maybe sql list be better, but here it is.
>
> It seems not to be possible to compare different numeric data types
> such as numeric and double precision. I get this error:
>
> Unable to identify an operator '<=' for types 'numeric' and 'double
> precision'
>
> Is it planned to do this comparissions in the future?
>
> It's possible to make a cast but I don't like this approach.
> It would be better if can be made transparently.

There have been reams of discussion about automatic coercion. Have a
look through the archives.

One thing you might try is to put both values in single quotes.
They'll make it into the system as text, and the system will probably
pick a reasonably sane type for them at the time of comparison.

A

--
----
Andrew Sullivan 204-4141 Yonge Street
Liberty RMS Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info> M2P 2A8
+1 416 646 3304 x110

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-02-03 15:45:25 Re: Database access problem : SOS
Previous Message mjoseph 2003-02-03 15:18:41 Database access problem : SOS