Re: [HACKERS] NUMERIC type conversions leave much to be desired

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] NUMERIC type conversions leave much to be desired
Date: 1999-05-09 21:16:36
Message-ID: 3735FB34.95213B83@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-05-09 21:41:56 Re: [HACKERS] NUMERIC type conversions leave much to be desired
Previous Message Taral 1999-05-09 20:52:17 Re: [HACKERS] Oops, I seem to have changed UNION's behavior