Re: [HACKERS] lexing small ints as int2

2010-09-05 Thread Robert Haas
On Sun, Sep 5, 2010 at 1:05 AM, Tom Lane wrote: > Robert Haas writes: >> I am not too sure that the distinction between implicit casts and >> assignment casts is all that useful; > > We've been there and done that; it doesn't work.  The current scheme > was invented specifically because a two-way

Re: [HACKERS] lexing small ints as int2

2010-09-04 Thread Tom Lane
Robert Haas writes: > I am not too sure that the distinction between implicit casts and > assignment casts is all that useful; We've been there and done that; it doesn't work. The current scheme was invented specifically because a two-way design didn't work. http://archives.postgresql.org/pgsql

Re: [HACKERS] lexing small ints as int2

2010-09-04 Thread Robert Haas
On Sat, Sep 4, 2010 at 12:26 AM, Tom Lane wrote: > Robert Haas writes: >> Maybe the lexer isn't the right place to fix this.  The problem here >> (or so I gather) is that if I say foo(1), then 1 is an integer and >> we'll do an "implicit" cast to bigint, real, double precision, >> numeric, oid, o

Re: [HACKERS] lexing small ints as int2

2010-09-03 Thread Tom Lane
Alvaro Herrera writes: > Excerpts from Tom Lane's message of vie sep 03 19:36:06 -0400 2010: >> 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? O

Re: [HACKERS] lexing small ints as int2

2010-09-03 Thread Tom Lane
Robert Haas writes: > Maybe the lexer isn't the right place to fix this. The problem here > (or so I gather) is that if I say foo(1), then 1 is an integer and > we'll do an "implicit" cast to bigint, real, double precision, > numeric, oid, or reg*, but the cast to smallint is assignment-only. > B

Re: [HACKERS] lexing small ints as int2

2010-09-03 Thread Robert Haas
On Fri, Sep 3, 2010 at 9:19 PM, Alvaro Herrera wrote: > The problem I'm facing is functions declared to take type smallint not > working unless the integer literal has an explicit cast.  Currently the > best answer is simply to avoid using smallint in functions, but this > isn't completely satisfy

Re: [HACKERS] lexing small ints as int2

2010-09-03 Thread Alvaro Herrera
Excerpts from Tom Lane's message of vie sep 03 19:36:06 -0400 2010: > > 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-hacker

Re: [HACKERS] lexing small ints as int2

2010-09-03 Thread Tom Lane
Alvaro Herrera 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

[HACKERS] lexing small ints as int2

2010-09-03 Thread Alvaro Herrera
Hi, 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 did some searches on the archives but no keywords I search for