Re: Prefered Types
Peter Eisentraut <peter_e@gmx.net>
From: Peter Eisentraut <peter_e@gmx.net>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>, Зотов Роман <zotov@oe-it.ru>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2011-05-07T21:24:52Z
Lists: pgsql-hackers
On fre, 2011-05-06 at 18:38 -0300, Alvaro Herrera wrote: > I remember that one of the problems put forth against this idea was > that stuff like int2+int2 which currently returns int2 would have to > be changed to return int4, otherwise it risks overflow which it > currently doesn't (not because the operator would change, but rather > because some expressions would be lexed differently). And so on with > other operators. I am not sure how severe this problem is for users > in practice -- my uneducated guess is that mostly they will not care > about such changes. Modulo backward compatibility concerns, I don't think it would necessarily be wrong if int2+int2 returned int4. sum(int2) returns int8, and no one seems bothered by that.