Re: Re: Bug in user-defined types? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: Bug in user-defined types?
Date
Msg-id 2826.986309145@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug in user-defined types?  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-hackers
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> If we made the scanner aware of integers larger than int4, we would have
> to choose between int8 (not supported on all platforms, but mostly OK)
> and numeric, which is markedly slower to process and handle. I recall
> that Tom Lane had the proposal to use a more loosely categorized "some
> kind of numeric type" in the scanner, postponing the hard assignment of
> type to later in the parser. That might get around the performance
> issues, since numeric would only be used if the context required it.

Yes, I was thinking of treating numerical literals more like we already
treat unknown-type string literals: keep the value in string format
until we deduce from context which type it should be, then convert.
Internally this already happens for literals that don't fit in int4,
but we still prejudge the type sooner than I think we should.

IIRC, the main reason this isn't done yet was that we hadn't come to
a conclusion about the appropriate type promotion hierarchy for
numeric values.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: Bug in user-defined types?
Next
From: Thomas Lockhart
Date:
Subject: Final call for platform testing