Re: Casting numeric values to double

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Daniel Schregenberger" <npfdd(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Casting numeric values to double
Date: 2005-10-03 14:30:58
Message-ID: 22047.1128349858@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Daniel Schregenberger" <npfdd(at)gmx(dot)net> writes:
> If I compare a field of type "numeric" to a small decimal constant like
> "3.6", the constant is interpreted as a "double precision" value and the
> comparison fails with the following message:
> # SELECT * FROM tr_table_okpx WHERE prating >= 3.6;
> Unable to identify an operator '>=' for types 'double precision' and
> 'numeric'
> You will have to retype this query using an explicit cast

> I'm using Postgre 7.2, which might be a bit outdated but I could not find
> any information whether this behaviour has changed in newer versions.

More than "a bit" outdated, and yes it has.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nirmalya Lahiri 2005-10-03 14:55:54 Re: Broken pipe
Previous Message Richard_D_Levine 2005-10-03 14:28:08 Re: Portable PostgreSQL