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

From Thomas Lockhart
Subject Re: [HACKERS] NUMERIC type conversions leave much to be desired
Date
Msg-id 3735FB34.95213B83@alumni.caltech.edu
Whole thread Raw
In response to Re: [HACKERS] NUMERIC type conversions leave much to be desired  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] NUMERIC type conversions leave much to be desired
List pgsql-hackers
> One potential problem is that if the value is large/small enough to make
> float8out use 'E' notation, conversion to numeric will still fail ---
> this is the same problem you hacked around in float8_numeric() earlier.

Yup. But in the long run, that is a problem for numeric(), not float8.
If nothing else, numeric() should be willing to flag cases where it
has trouble, and it doesn't seem to do that. That should probably be
considered a "must fix" for v6.5.

> 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. Also, there might be a
performance hit if we ended up having to do the string conversion too
many times. 

At this late date, I'm (so far) happy doing the kinds of fixes we've
done, but we should revisit the issue for v6.5.x...
                    - Thomas

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California


pgsql-hackers by date:

Previous
From: Taral
Date:
Subject: Re: [HACKERS] Oops, I seem to have changed UNION's behavior
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] NUMERIC type conversions leave much to be desired