Re: Smallint needs explicit cast in psql? - Mailing list pgsql-novice

From Tom Lane
Subject Re: Smallint needs explicit cast in psql?
Date
Msg-id 13145.1342458230@sss.pgh.pa.us
Whole thread Raw
In response to Smallint needs explicit cast in psql?  (Matt Musgrove <MMusgrove@efji.com>)
Responses Re: Smallint needs explicit cast in psql?  (Matt Musgrove <MMusgrove@efji.com>)
List pgsql-novice
Matt Musgrove <MMusgrove@efji.com> writes:
> Does psql require smallints to be explicitly cast as such?

Undecorated integer-looking constants are taken as integer, bigint, or
numeric depending on size.  Not smallint.  By and large it's best
not to use smallint as the declared argument type of a function unless
you really have to.

(We have looked into allowing small-enough literals to be taken as
smallint.  Turns out to break a whole lot of stuff, by introducing
ambiguities where there were none before, so it's not likely
to ever happen.)

            regards, tom lane

pgsql-novice by date:

Previous
From: Matt Musgrove
Date:
Subject: Smallint needs explicit cast in psql?
Next
From: Matt Musgrove
Date:
Subject: Re: Smallint needs explicit cast in psql?