Re: lexing small ints as int2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: lexing small ints as int2
Date: 2010-09-03 23:36:06
Message-ID: 2023.1283556966@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2010-09-03 23:43:51 Re: regclass without error?
Previous Message Tom Lane 2010-09-03 23:09:25 Re: ps buffer is incorrectly padded on the (latest) OS X