~/talk

Should I use JSON in PostgreSQL?

Talkat PostgreSQL Conference Europe 2023 · 2023-12-12..12-15· [databases]
slides:none on file

Conclusion: PostgreSQL works well with JSON when design splits stable columns (id, foreign keys) from dynamic fields stored as JSONB; the demo builds bands, albums and reviews tables with JSONB payloads, adds primary/foreign keys, creates a unique expression index on a JSONB key, and enforces types via CHECK casting to double precision — all queries and indexes run in the demo and return correct results. Performance notes: JSONB updates rewrite the value (large blobs can be expensive) and PostgreSQL 16 adds improved JSON/SQL checks. use JSONB not JSON B-tree for scalars, GIN for arrays, pg_trgm for text validate with CHECK casting or indexed expression

AI-written summary · about

  1. 0:00Introduction
  2. 1:17Why JSON
  3. 1:33Schema Freedom
  4. 4:52JSON Object
  5. 5:42Metal Bands
  6. 8:28Splitting JSON Objects
  7. 9:22Review
  8. 11:53Paths
  9. 12:51Updating JSON values
  10. 22:14Search
  11. 28:22Index
  12. 33:27SQL Json
  13. 40:47Questions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.