Lesson 2.3

Data types and JSONB

Postgres has rich types, and JSONB for the genuinely unstructured remainder. Reaching for JSONB too early throws away every guarantee above.

Taught byDaniel OkaforTypeScript · PostgreSQL · API design · Data modelling
13m Intermediate 8,818 students

Overview

Postgres has rich types, and JSONB for the genuinely unstructured remainder. Reaching for JSONB too early throws away every guarantee above.

What this lesson covers

  • Pick precise types for time, money, and identifiers
  • Use JSONB for genuinely variable data only
  • Index inside a JSONB column when you must query it

This lesson sits in Schema Design, part of PostgreSQL for Developers. It assumes what came before it and leads directly into the next lesson in the module.

In this lesson you will:

  • Pick precise types for time, money, and identifiers
  • Use JSONB for genuinely variable data only
  • Index inside a JSONB column when you must query it

Resources