INT2 is a fixed-precision, signed 16-bit integer data type. It can hold whole-number values from -32,768 to 32,767. Although INT2 is functionally equivalent to SMALLINT in the SQL standard, the literal keyword INT2 is primarily recognized by PostgreSQL and a few engines with PostgreSQL compatibility layers. Using INT2 helps conserve storage when the range of values fits inside two bytes, and can slightly improve cache efficiency on very wide tables. Arithmetic operations on INT2 promote values to a wider integer type (INT4) during computation in PostgreSQL, so performance differences are usually negligible. Be mindful of implicit casts: inserting a number outside the valid range raises an error, and comparing INT2 with larger numeric types can trigger implicit up-casting.
SMALLINT, INT, INT4, INT8, NUMERIC, CAST, DOMAIN
PostgreSQL 7.0
PostgreSQL treats INT2 and SMALLINT as exact synonyms. Other databases only recognize SMALLINT.
Each INT2 value occupies exactly 2 bytes of on-disk storage in PostgreSQL.
Yes - use ALTER TABLE ... ALTER COLUMN ... TYPE INT2, but first ensure no values exceed the INT2 range.
Disk I/O can improve slightly for wide, read-heavy tables because less data is moved. CPU performance is usually unchanged.