PostgreSQL Data Type Reference
A searchable reference of PostgreSQL data types - numeric, character, date/time, JSONB, arrays, UUID, and network types.
Search or browse PostgreSQL's data types by category, including some PostgreSQL-specific types like JSONB, arrays, and UUID.
More Database & SQL Tools
View all 20For the equivalent reference on a different database, see the MySQL Data Type Reference or SQL Server Data Type Reference.
What Is This Reference?
A searchable list of PostgreSQL's data types, including several types less common in other databases - native array columns, the UUID type, network address types (inet, cidr), and both JSON and the more commonly recommended JSONB.
Why Use This Tool?
PostgreSQL's richer type system offers genuinely useful options (like JSONB's indexing support, versus plain JSON) that aren't obvious if you're used to a simpler type system. This reference explains what each one is actually good for.
How to Use It
- Search for a type name or keyword.
- Review its description and typical use case.
Limitations
This covers commonly-used PostgreSQL types - for full behavioral detail on any one type, PostgreSQL's own documentation remains authoritative.
Choosing Types: Quick Recommendations
| You need | Use | Why |
|---|---|---|
| Auto-incrementing ID | bigint GENERATED ALWAYS AS IDENTITY | The modern replacement for serial |
| Public or distributed ID | uuid | Unguessable, can be created in the app |
| Text of any length | text | Same performance as varchar in PostgreSQL |
| Money | numeric(12,2) | Exact decimals - never real or double precision |
| Point in time | timestamptz | Stores an absolute moment, avoiding time zone bugs |
| Flexible attributes | jsonb | Indexable with GIN, faster to query than json |
| List of tags | text[] | Native arrays with @> and ANY() queries |
| IP address | inet | Validation plus subnet operators |
Example Table
CREATE TABLE orders (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
public_id uuid NOT NULL DEFAULT gen_random_uuid(),
total numeric(12,2) NOT NULL,
tags text[] NOT NULL DEFAULT '{}',
meta jsonb NOT NULL DEFAULT '{}',
created_at timestamptz NOT NULL DEFAULT now()
);
gen_random_uuid() is built in from PostgreSQL 13.
Compare with the MySQL and SQL Server references, or build a table with the SQL Table Generator.
Frequently Asked Questions
Explore More Tools
Keep going with related categories and our most used tools.