Re: Comparing different numeric data types - Mailing list pgsql-general

From Andrew Sullivan
Subject Re: Comparing different numeric data types
Date
Msg-id 20030203104348.E17659@mail.libertyrms.com
Whole thread Raw
In response to Comparing different numeric data types  (Vicente Alabau Gonzalvo <vicente.alabau-gonzalvo@cgey.com>)
List 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@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110


pgsql-general by date:

Previous
From: mjoseph@inautix.com
Date:
Subject: Database access problem : SOS
Next
From: Tom Lane
Date:
Subject: Re: [ADMIN] Database access problem : SOS