PostgreSQL 15.3 Documentation

Chapter 4. SQL Syntax

node-postgres

Data Types

Number types

Name Storage Size Range
smallint 2 bytes -32768 to +32767
integer 4 bytes -2147483648 to +2147483647
bigint 4 bytes -9223372036854775808 to 9223372036854775807
decimal variable up to 131072 digits before the decimal point; up to 16383 digits after the decimal point
numeric variable up to 131072 digits before the decimal point; up to 16383 digits after the decimal point
real 4 bytes 6 decimal digits precision
double 8 bytes 15 decimal digits precision

Serial Types

Name Storage Size Range
smallserial 2 bytes 1 to 32767
serial 4 bytes 1 to 2147483647
bigserial 8 bytes 1 to 9223372036854775807

Monetary Types

Name Storage Size Range
money 8 bytes -92233720368547758.08 to 92233720368547758.07