Skip to content
All terms
Postgres

JSONB

JSONB is Postgres's binary JSON column type (added in 9.4). Unlike the text-based json type, JSONB parses, normalises, and indexes JSON at insert time. It supports rich operators (->>, @>, ?), can be indexed with GIN, and is the standard answer for "I need flexible-shape data inside Postgres".

Use cases: provider-variable webhook payloads, user-defined metadata, sparse columns where promoting them all to first-class columns would create wide sparse tables. The 2026 best practice is "promote on demand" - start in JSONB, move a key to a real column the first time you filter on it.

JSONB does not enforce types or shape. If you need that, pair it with a CHECK constraint or a validator at the application layer.

Read further