INT8 stores whole numbers from −9 223 372 036 854 775 808 to 9 223 372 036 854 775 807 using 8 bytes of storage. In PostgreSQL it is a direct synonym for BIGINT, while other databases may recognize only BIGINT or support INT8 through ODBC compatibility layers. INT8 supports standard arithmetic, comparison, aggregate, and index operations. When values exceed the range, the database raises an overflow error. Because INT8 is strictly integer, fractional input is truncated or rejected depending on the dialect. INT8 columns can be indexed efficiently and often serve as primary keys, counters, monetary amounts stored in the smallest currency unit, or Unix epoch timestamps when millisecond precision is not required. 64-bit integers consume twice the space of INT4 but offer a vastly larger range. Some dialects (MySQL, SQL Server) do not accept the INT8 keyword; use BIGINT instead. SQLite accepts INT8 in a column declaration but internally stores values as dynamic-typed INTEGERs up to 8 bytes.
BIGINT, INT, INT4, SMALLINT, SERIAL8, NUMERIC, CAST
PostgreSQL 6.1 (1997)
INT8 handles any whole number between −9 223 372 036 854 775 808 and 9 223 372 036 854 775 807 inclusive.
In PostgreSQL and many analytical databases, INT8 is a direct alias for BIGINT, so they behave identically.
Those systems accept the BIGINT keyword instead. Replace INT8 with BIGINT for full compatibility.
Use CAST(expression AS INT8) or the :: operator in PostgreSQL, for example: SELECT '42'::INT8;