8.1.1. Integer Types
8.1.1. Integer type
The types
smallint
,
integer
, and
bigint
store whole numbers, that is, numbers without fractional
components, of various ranges. Attempts to store values outside of the allowed range will result
in an error.
smallint, integer store both integer and bigint type, i.e. without fractional part, their scope is different. Try to store beyond the permitted range of values will result in an error.
The type
integer
is the common choice, as it offers the best balance between range, storage size, and
performance. The
smallint
type is generally only used if disk space is at a premium. The
bigint
type is designed to be used when the range of the
integer
type is insufficient.
The most common type integer, because it balances the range, storage size and performance.
Smallint type is generally used only in limited disk space. bigint type used if the integer type of range.
SQL only specifies the integer types
(or
int
),
smallint
, and
bigint
. The type names
int2
,
int4
, and
int8
are extensions, which are also used by some other SQL database systems.
SQL standard specifies only the type integer (or int), smallint, and bigint. Type the name of int2, int4 and int8 are extensions, other SQL database systems also use these extensions.