Re: [HACKERS] ERROR: Unable to identify an operator '=' for types 'numeric' and 'float8' - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] ERROR: Unable to identify an operator '=' for types 'numeric' and 'float8'
Date
Msg-id 14988.950773126@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] ERROR: Unable to identify an operator '=' for types 'numeric' and 'float8'  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-hackers
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
>> I proposed a while back that T_Float tokens ought to carry the value in
>> string form, rather than actually converting it to float,

> No fair only doing it for float8; int4 has the same trouble.

Au contraire: int representation has no risk of loss of precision.
It does risk overflow, but we can detect that reliably, and in fact
scan.l already takes care of that scenario.

If we allow ints to retain their current representation, then the
manipulations currently done in gram.y don't need to change.  All
that's needed is to invoke the proper typinput function after we've
decided what type we really want to convert a T_Float to.  T_Float
would act kind of like UNKNOWN-type string constants, except that
the knowledge that the string looks numeric-ish could be used in
type selection heuristics.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Almost there on column aliases
Next
From: Hannu Krosing
Date:
Subject: Re: [HACKERS] FYI: BNF for SQL93 and SQL-3