Developer Tools
PostgreSQL Data Types Reference
Searchable PostgreSQL data types reference. Storage size, value range, DDL examples, and notes for numeric, character, date, JSON, UUID, and range types.
33 of 33
Filter by family
Numeric
bigint
Eight-byte signed integer used for large counters and ids.
Storage
8 bytes fixed
Range
-9,223,372,036,854,775,808 to +9,223,372,036,854,775,807
DDL column
order_id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY
Insert
INSERT INTO orders DEFAULT VALUES;
Readback
order_id | bigint
---------+-------
1 |What it does
bigint stores a signed 64-bit value. It is the right default for surrogate primary keys today: storage is cheap, and the 2 billion cap on integer is a real problem in growing systems. Many bigint operations are slightly slower than integer on 32-bit platforms but the difference is negligible on modern hardware.
Notes
Prefer GENERATED ALWAYS AS IDENTITY over the legacy bigserial helper. IDENTITY is the SQL-standard form and is what newer ORMs produce.
Also searched as
int8 · int 8 · bigint · long int · long integer
Common use cases
- Surrogate primary keys for high-volume tables
- Unix timestamps stored as nanoseconds or microseconds
- Counters and sequence-backed identifiers
Related types
integer · bigserial · numeric(p, s)
This reference covers 33 PostgreSQL data types drawn from the official documentation (Numeric, Character, Date/Time, Boolean, UUID, Binary, Network, JSON, Geometric, Container, and Special). Storage figures match the planner row width estimates used in EXPLAIN. Examples are minimal and copy-ready. Everything is pre-baked and rendered locally in your browser. No upload, no remote dictionary.
How to use
- Type a PostgreSQL type name, family, or alias into the search box (try text, varchar, numeric, timestamptz, jsonb, uuid, int4, money).
- Click a family chip (Numeric, Character, Date and time, JSON, UUID, Network, Container) to filter the catalog.
- Click any entry card to pin its detail view, which shows storage, value range, a DDL column example, an INSERT example, and the readback shape.
- Read the notes section for PostgreSQL-specific gotchas (timestamp vs timestamptz, varchar vs text, json vs jsonb, serial vs identity).
- Use Copy entry to grab a markdown-formatted block for a runbook or pull request comment, or Copy full reference to export the whole cheat sheet at once.
About this tool
PostgreSQL Data Types Reference is a searchable, copy-ready cheat sheet for every PostgreSQL data type a developer reaches for when writing DDL, designing a schema, or tuning column widths in EXPLAIN. Entries cover the eleven families from the official docs: numeric (smallint, integer, bigint, numeric, real, double precision, the serial helpers, and money), character (text, varchar, char, citext from contrib), date and time (date, time, timestamp, timestamptz, interval), boolean, uuid, binary (bytea), network address (inet, cidr, macaddr), JSON (jsonb and json), geometric (point and the planar family), container (arrays, numeric and date and time range types), and the special system types (oid, pg_lsn). Each entry carries the exact storage footprint (smallint = 2 bytes fixed, numeric = around 5 bytes plus 2 bytes per group of four digits, bytea = variable up to 1 GB), the value range, a one-paragraph description that captures the PostgreSQL-specific behavior a developer actually cares about (TOAST limits, alignment padding, timezone semantics, JSONB key normalization, default 1-based array indexing), a worked DDL column declaration ready to drop into a CREATE TABLE statement, an INSERT example that exercises the type, and the way the value reads back from the server. A search box scores matches across the type name, family, aliases (int4, int8, character varying, double precision), and use cases, so a query like 'currency' surfaces numeric and money side by side. Filters group results into the eleven canonical families. Each detail card includes a copy button for the entry, the DDL, the insert, the readback, plus a 'related types' row that links to the obvious siblings (smallint and bigint next to integer, jsonb next to json, timestamptz next to timestamp). Notes call out the gotchas seasoned PostgreSQL engineers wish they had read sooner: prefer GENERATED ALWAYS AS IDENTITY over serial, varchar(n) and text are storage-identical so reach for text by default, money formatting depends on lc_monetary and is rarely what an application wants, json preserves bytes while jsonb normalizes them, timestamptz stores UTC and re-renders in the session zone, and arrays make a poor stand-in for a child table when you need referential integrity. Useful for backend engineers writing migrations, data platform teams designing a fact table, database administrators sizing storage, students working through the PostgreSQL tutorial, and code reviewers double-checking a column type before approving a pull request. Everything ships pre-baked and runs locally in your browser. No upload, no remote dictionary, no signup.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
SQL Formatter
Pretty print SQL with configurable keyword case, indent, and comma style.
Open tool
DeveloperSQL JOIN Visualizer
Interactive SQL JOIN cheat sheet with a live result table and Venn diagram.
Open tool
ConverterCSV to SQL Converter
Turn CSV rows into portable SQL INSERT statements for any major database.
Open tool
ConverterJSON to SQL Converter
Turn JSON rows into portable SQL INSERT statements for any major database.
Open tool
DeveloperDatabase Connection String Parser
Decode database URIs with driver detection, host breakdown, TLS check, and warnings.
Open tool
DeveloperJSON to TypeScript Converter
Generate TypeScript interfaces or types from any JSON value with full inference.
Open tool