Skip to content
skillbld
Day 13 of 14 35 minJSONBGINtsvector

Two PostgreSQL superpowers. Store flexible JSON documents in JSONB columns and query inside them, and add real search with tsvector, tsquery and ranking.

By the end of today you can

  • Store and read JSON documents in a JSONB column
  • Extract values with -> and ->>, and filter with @>
  • Index JSONB with GIN
  • Turn text into searchable tsvector documents
  • Search with websearch_to_tsquery and rank results

What's inside

  • 4 sections
  • 3 diagrams and mind maps
  • 6 code examples you can run
  • 4-question quiz
  1. 1JSONB: documents inside rows
  2. 2Reading values: -> and ->>
  3. 3Filtering: @> means "contains"
  4. 4Full-text search

Sign in free to read this lesson

Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.

Sign in free
Day 13: JSONB & Full-Text Search · PostgreSQL · SkillBld