Re: lexing small ints as int2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: lexing small ints as int2
Date
Msg-id 2023.1283556966@sss.pgh.pa.us
Whole thread Raw
In response to lexing small ints as int2  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: lexing small ints as int2
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> I'm researching if smallint can be made a higher-class citizen of our type
> system than currently.

> Does anyone know where to find the discussion refered to here?
> http://archives.postgresql.org/pgsql-hackers/2008-10/msg01485.php

I think this was the last time I tried it:
http://archives.postgresql.org/pgsql-hackers/2002-11/msg00468.php

At the time, the main motivation for worrying about it was that cases
like "WHERE smallintcol = 42" couldn't be indexed, because 42 is int4
not int2.  We've since fixed that by allowing cross-type operators
to be indexable.

I also notice that one of the failure cases I cited might no longer be
an issue now that we don't have implicit casts to text, but that change
isn't going to do anything for the other cases.

On the whole I'm still afraid that changing the initial typing of
integer constants is going to break a lot of code while buying not much.
Do you have a specific reason for reopening the issue?  Or is your
concern something different?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ps buffer is incorrectly padded on the (latest) OS X
Next
From: Tatsuo Ishii
Date:
Subject: Re: regclass without error?