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 2145.926265844@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:
> OK, and while I was looking at it I noticed that the T_Integer code
> didn't bother using the int4out() routine to generate a string. imho
> it should be using the official output routine unless there is some
> compelling reason not to. It seems to still behave with this fix in
> the T_Integer support code; should I commit both?

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.

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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Niladic functions
Next
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] Niladic functions