Searchable PostgreSQL cheat sheet, 80+ entries that
backend engineers, DBAs and data folks actually type into
psql — not a beginner SELECT * tour. Thirteen sections:
psql meta-commands (\l \dt \d \du \q \i \timing \x \!
\conninfo \copy \dn \df), data types (text vs varchar,
int / bigint / serial / bigserial / identity, uuid,
timestamp with vs without time zone, interval, jsonb vs
json, array, enum, range), DDL (CREATE / ALTER / DROP
with IF EXISTS and CASCADE, generated columns, table
inheritance), DML (INSERT, UPDATE, DELETE, RETURNING,
INSERT ... ON CONFLICT for atomic UPSERT), JSONB operators
(-> ->> #> #>> @> ? ?| ?& || jsonb_build_object jsonb_set
jsonb_path_query indexing with GIN), CTEs (WITH ... AS,
RECURSIVE tree walks, MATERIALIZED hint), window functions
(ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD, NTILE, ROWS vs
RANGE frames, FIRST_VALUE, named WINDOW clause), indexes
(B-tree, GIN, GiST, BRIN, partial, expression / functional,
covering with INCLUDE, CREATE INDEX CONCURRENTLY), table
partitioning (PARTITION BY RANGE / LIST / HASH, attach /
detach, partition pruning), replication & backups (pg_dump,
pg_restore, pg_basebackup, streaming replication, logical
replication, WAL), roles & permissions (CREATE ROLE, GRANT,
REVOKE, pg_hba.conf auth methods, search_path, row-level
security), popular extensions (pg_stat_statements, pg_trgm,
postgis, uuid-ossp, hstore, pgcrypto, citext), and money-
burning pitfalls (NULL comparison, vacuum bloat, big-table
ALTER, sequence drift, WAL filling the disk, timezone
surprises, search_path security). Every entry: command +
EN/ZH description + 1-3 real psql-pasteable examples +
common pitfall. Search across all fields plus category
chips. Pure client-side — no DB connection, no upload.
Pair with SQL Formatter, SQL Cheatsheet and our Docker /
kubectl / Regex cheat sheets.