Re: [HACKERS] NUMERIC type conversions leave much to be desired - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] NUMERIC type conversions leave much to be desired
Date
Msg-id 3345.926286116@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] NUMERIC type conversions leave much to be desired  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-hackers
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
>> I still like the idea of hanging on to the original string form of the
>> constant long enough so that parser_typecast can feed that directly to
>> the target type's xxx_in() routine, and not have to worry about
>> conversion errors.

> I agree. I'm just worried about losing the typing hints provided by
> scan.l if we went to a "string only" solution.

No no, I didn't say that you can't keep T_Integer and T_Float nodes
separate.  I was just suggesting that the *value* of one of these nodes
might be kept as a string (or, perhaps, both as a string and the numeric
format).  That way, if you need to convert to some other type, you start
from the original string and don't have to risk a "lossy compression"
into floating point.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] NUMERIC type conversions leave much to be desired
Next
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] New version of CVSup built for linux