| PostgreSQL Reference Manual - Volume 1 - SQL Language Reference by The PostgreSQL Global Development Group Paperback (6"x9"), 716 pages ISBN 0954612027 RRP £32.00 ($49.95) Sales of this book support the PostgreSQL project! Get a printed copy>>> |
6.1.1 Integer Types
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.
The type integer is the usual 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 should only
be used if the integer range is not sufficient,
because the latter is definitely faster.
The bigint type may not function correctly on all
platforms, since it relies on compiler support for eight-byte
integers. On a machine without such support, bigint
acts the same as integer (but still takes up eight
bytes of storage). However, we are not aware of any reasonable
platform where this is actually the case.
SQL only specifies the integer types
integer (or int) and
smallint. The type bigint, and the
type names int2, int4, and
int8 are extensions, which are shared with various
other SQL database systems.
| ISBN 0954612027 | PostgreSQL Reference Manual - Volume 1 - SQL Language Reference | See the print edition |