PostgreSQL guides and tutorials

These guides are about Postgres itself. Each one starts from a problem you can hit in production, reproduces it with SQL you can paste into psql, and ends with a fix you can check. They target PostgreSQL 17, the version Relyt One runs, and most of what they cover applies to any recent Postgres. Follow the reading path below in order, or jump straight to the guide that matches your problem.

11 articles

Start here

Four guides, in the order we suggest: change a schema without locking your table, get queries onto your indexes, keep row-level security closed, then check what changes if you come from Postgres 18.

  1. Postgres migrations that lock your table: what each ALTER TABLE takes, and how to ship it safelyWhy a one-line ALTER TABLE can stall every query on a table, which lock each common migration takes on PostgreSQL 17, which ones rewrite the table, and the lock_timeout, NOT VALID and CONCURRENTLY patterns that keep production running.
  2. Why Postgres isn't using your index: seven causes, with EXPLAIN output you can reproduceYou created the index and EXPLAIN still shows a sequential scan. Seven reasons PostgreSQL ignores an index (functions, casts, wildcards, selectivity, stale statistics, column order, tiny tables), each with a reproduction and a fix.
  3. Five ways row-level security fails openRow-level security is the best defense against a forgotten WHERE clause, until it silently stops applying. Five ways it fails open on PostgreSQL 17, each with a reproduction, a fix, and a catalog query that catches it in CI.
  4. Coming from Postgres 18? What to change for Postgres 17Relyt One runs PostgreSQL 17. If your schema or your habits come from Postgres 18, here is what fails on 17, what to write instead, and how to load a dump taken on 18, with every snippet run on both versions.

More posts tagged Postgres

RSS feed