Re: Working on "SELECT * WHERE numeric_col = 2001.2" problem?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bob Jones" <bjones(at)autoresourcesinc(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Working on "SELECT * WHERE numeric_col = 2001.2" problem?
Date: 2001-12-14 02:01:52
Message-ID: 1220.1008295312@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Bob Jones" <bjones(at)autoresourcesinc(dot)com> writes:
> ... an error stating that the '=' operator is unidentified for
> numeric and float8 types.
> After receiving this error, I checked the doc/TODO file and found that
> the deficiency was known...\
> Is this an issue that is to be addressed in later (hopefully in the near
> future?) revisions of pgsql, or is it a relatively low priority?

It's not so much that it's low priority as that a non-hack solution
requires some rather subtle revisions of Postgres' type system, and
there's not yet agreement on how to do that. (Look through the
pghackers list archives if you want to see the previous discussions.)

Quick-hack solutions include (a) persuading your client program to
put single-quotes around the literal, or (b) defining your own
numeric-vs-float8-equals operator. AFAIK (b) would not support the
use of indexes on the numeric column, so it's not a very good solution,
but it might do as a stopgap.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2001-12-14 02:02:41 Re: Correction: Working on "SELECT * WHERE numeric_col =
Previous Message Stephan Szabo 2001-12-14 01:52:11 Re: dropping foreign keys