CtrlK
BlogDocsLog inGet started
Tessl Logo

alonso-skills/postgres

Comprehensive PostgreSQL reference for developers and DBAs covering versions 14–18. Use whenever the user asks about PostgreSQL syntax, DDL/DML/DQL, joins, LATERAL, CTEs, window functions, GROUPING SETS, DISTINCT ON, RETURNING, ON CONFLICT, PL/pgSQL, functions, procedures, triggers, views, materialized views, indexes (B-tree/GIN/GiST/BRIN/Hash/Bloom), MVCC, VACUUM, autovacuum, WAL, TOAST, partitioning, replication (streaming/logical), backup, PITR, HA (Patroni/repmgr), pgBouncer, EXPLAIN ANALYZE, RLS, roles, extensions (pgvector, PostGIS, TimescaleDB, Citus, pg_trgm, pg_cron), JSON/JSONB, full-text search, UUID, timestamptz, COPY, system catalogs, collations, large objects, cursors, GUC, or any Postgres administration, performance, security, replication, backup, or recovery topic.

94

1.36x
Quality

94%

Does it follow best practices?

Impact

94%

1.36x

Average score across 3 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

SKILL.md

name:
postgres
description:
Comprehensive PostgreSQL reference for developers and DBAs covering versions 14–18. Use whenever the user asks about PostgreSQL syntax, DDL/DML/DQL, joins, LATERAL, CTEs, window functions, GROUPING SETS, DISTINCT ON, RETURNING, ON CONFLICT, PL/pgSQL, functions, procedures, triggers, views, materialized views, indexes (B-tree/GIN/GiST/BRIN/Hash/Bloom), MVCC, VACUUM, autovacuum, WAL, TOAST, partitioning, replication (streaming/logical), backup, PITR, HA (Patroni/repmgr), pgBouncer, EXPLAIN ANALYZE, RLS, roles, extensions (pgvector, PostGIS, TimescaleDB, Citus, pg_trgm, pg_cron), JSON/JSONB, full-text search, UUID, timestamptz, COPY, system catalogs, collations, large objects, cursors, GUC, or any Postgres administration, performance, security, replication, backup, or recovery topic.

PostgreSQL Skill

This skill is the working reference for PostgreSQL 16, 17, and 18 (current baseline: PG16). Cross-version notes go back to PG14 where behavior changed; PG13 and earlier are end-of-life and out of scope. PG14 reaches end-of-life on 2026-11-12 — flag upgrade urgency when a user is on it.

The skill is provider-neutral: bare-metal/self-hosted, containers, and Kubernetes operators are all covered. Managed-service limitations are called out categorically ("most managed providers disable X") without naming or recommending any specific vendor.

Each topic lives in its own reference file under references/. SKILL.md routes a user question to the right reference; the reference contains the executable detail, version admonitions, and primary-source citations.

Usage Workflow

When this skill is loaded, follow these steps to answer the user's question:

  1. Identify the topic. Match the user's question against the Routing Table below using the keyword column. For multi-topic questions (e.g. "the locking behavior of REINDEX CONCURRENTLY") select multiple files.
  2. Load the matched reference file(s). Use the Read tool against references/NN-topic.md. Do not paraphrase from memory — the reference holds the authoritative version notes and source URLs.
  3. Follow See Also. Each reference ends with a See Also section linking related files. Follow it for cross-cutting questions (e.g. a VACUUM question pulls in MVCC, autovacuum, and wraparound).
  4. Answer using the file. Lead with the direct answer or code, then version notes via admonitions, then caveats, then citation URLs.
  5. Never answer from memory alone when a reference file exists for the topic. The references are the source of truth for this skill; the model's training data is not version-specific enough.
  6. Assume PG16 unless told otherwise. If the user does not state a version, answer for PG16 and add a one-line note for differences on PG17/PG18. Only ask the user which version they are on if the answer materially changes across supported versions (e.g. wraparound mechanics, planner statistics behavior, archive_command vs archive_library).

[!NOTE] When a Postgres question does not obviously match a single file, load these cross-cutting entry points first: references/102-skill-cookbook.md (symptom-driven recipes spanning multiple files), references/22-indexes-overview.md (index decision routing), references/56-explain.md (plan reading), references/64-system-catalogs.md (catalog introspection).

User Response Format

Structure every answer using this skill as follows:

  • Lead with the direct answer or pattern. If a SQL snippet or psql command satisfies the question, put that first.
  • Add version admonitions inline. Use > [!NOTE] PostgreSQL 17 for new-in-17 features, > [!WARNING] Removed/Deprecated for things gone (with the version they were removed in and the replacement).
  • Call out managed-service limitations categorically when relevant. Phrase as "most managed providers disable X" — never name a specific provider.
  • End with source links. Cite the official PostgreSQL docs pinned to the correct major version (e.g. https://www.postgresql.org/docs/16/sql-vacuum.html, not /docs/current/).
  • For longer answers, use headers matching the reference file's section headings so the user can jump to the source.
  • For version-sensitive answers, default to PG16 + add inline > [!NOTE] PG17 / > [!NOTE] PG18 deltas. Only ask the user to confirm version when the answer flips between supported majors.
  • For any performance investigation document or slow-query guide, always include an explicit section explaining how to read EXPLAIN plans bottom-up: start at the deepest-indented leaf node (scans execute first), work upward through parents (joins, sorts, aggregates), reach the root last. Identify the first node where actual rows diverges 10× or more from estimated rows — that is the misestimate source; everything above it operates on bad cardinality.

Routing Table

Keywords are matched case-insensitively. A single file can match multiple keyword phrases.

KeywordsFileScope
CREATE TABLE, ALTER TABLE, DROP TABLE, schema, sequence, generated column, identity column, IF NOT EXISTSreferences/01-syntax-ddl.mdDDL syntax reference
SELECT, JOIN, LATERAL, subquery, UNION, INTERSECT, EXCEPT, DISTINCT ON, LIMIT, OFFSET, FETCH FIRSTreferences/02-syntax-dql.mdQuery (DQL) reference
INSERT, UPDATE, DELETE, RETURNING, ON CONFLICT, upsert, MERGE, DEFAULT VALUESreferences/03-syntax-dml.mdDML reference
WITH, CTE, recursive CTE, WITH RECURSIVE, MATERIALIZED, modifying CTEreferences/04-ctes.mdCommon Table Expressions
view, CREATE VIEW, updatable view, INSTEAD OF, security_barrier, security_invoker, materialized view, REFRESH MATERIALIZED VIEW CONCURRENTLYreferences/05-views.mdViews and materialized views
CREATE FUNCTION, LANGUAGE, IMMUTABLE, STABLE, VOLATILE, PARALLEL SAFE, SECURITY DEFINER, RETURNS TABLE, polymorphicreferences/06-functions.mdFunctions
CREATE PROCEDURE, CALL, transaction control in procedure, COMMIT in procedurereferences/07-procedures.mdProcedures
PL/pgSQL, plpgsql, DECLARE, BEGIN, EXCEPTION, RAISE, FOR LOOP, cursor in plpgsql, GET STACKED DIAGNOSTICSreferences/08-plpgsql.mdPL/pgSQL deep dive
plpython3u, plperl, plperlu, pltcl, plv8, procedural language, untrusted PLreferences/09-procedural-languages.mdNon-pgSQL procedural languages
EXECUTE, dynamic SQL, format(), quote_ident, quote_literal, SQL injection in plpgsqlreferences/10-dynamic-sql.mdDynamic SQL
OVER, PARTITION BY, window function, ROWS BETWEEN, RANGE BETWEEN, GROUPS, LAG, LEAD, FIRST_VALUE, LAST_VALUE, NTH_VALUE, RANK, DENSE_RANK, ROW_NUMBER, NTILEreferences/11-window-functions.mdWindow functions
aggregate, FILTER, GROUPING SETS, ROLLUP, CUBE, percentile_cont, percentile_disc, ordered-set aggregate, CREATE AGGREGATEreferences/12-aggregates-grouping.mdAggregates & grouping
DECLARE CURSOR, FETCH, MOVE, WITH HOLD, scrollable cursor, refcursor, PREPARE, EXECUTE, DEALLOCATE, plan_cache_modereferences/13-cursors-and-prepares.mdCursors & prepared statements
text, varchar, char, numeric, decimal, real, double precision, integer, boolean, bytea, inet, cidr, macaddr, bit, varbitreferences/14-data-types-builtin.mdBuilt-in types
CREATE TYPE, composite type, CREATE DOMAIN, ENUM, ALTER TYPE ADD VALUE, range type, multirangereferences/15-data-types-custom.mdCustom types (composite/domain/enum/range)
array, ARRAY[], unnest, array_agg, array_position, ANY, ALL, GIN on arrayreferences/16-arrays.mdArrays
JSON, JSONB, ->, ->>, #>, #>>, @>, jsonb_set, jsonb_insert, jsonb_path_query, jsonpath, JSON_TABLE, jsonb_ops, jsonb_path_opsreferences/17-json-jsonb.mdJSON / JSONB
uuid, gen_random_uuid, uuidv7, uuid-ossp, NUMERIC precision, money, serial, bigserial, IDENTITY columnreferences/18-uuid-numeric-money.mdUUID, numeric, money, identity
timestamp, timestamptz, AT TIME ZONE, interval, date_trunc, date_part, timezone, DST, infinity timestampreferences/19-timestamp-timezones.mdTimestamps & time zones
tsvector, tsquery, to_tsvector, to_tsquery, plainto_tsquery, phraseto_tsquery, websearch_to_tsquery, ts_rank, ts_headline, FTS, full-text searchreferences/20-text-search.mdFull-text search
hstorereferences/21-hstore.mdhstore extension
index decision, choose index type, multicolumn index, partial index, expression index, INCLUDEreferences/22-indexes-overview.mdIndex decision matrix
B-tree, btree, deduplication, bottom-up index deletion, fillfactor, INCLUDE columns, covering indexreferences/23-btree-indexes.mdB-tree indexes
GIN, GiST, KNN-GiST, jsonb_ops, jsonb_path_ops, EXCLUDE USING gist, fastupdate, gin_pending_list_limitreferences/24-gin-gist-indexes.mdGIN & GiST indexes
BRIN, minmax_multi, bloom index, hash index, SP-GiSTreferences/25-brin-hash-spgist-bloom-indexes.mdBRIN, hash, SP-GiST, bloom
CREATE INDEX CONCURRENTLY, REINDEX CONCURRENTLY, INVALID index, pg_repack, pg_squeeze, index bloatreferences/26-index-maintenance.mdIndex maintenance
MVCC, xmin, xmax, cmin, cmax, infomask, tuple visibility, snapshot, xip, MultiXactreferences/27-mvcc-internals.mdMVCC internals
VACUUM, autovacuum, VACUUM FULL, VACUUM FREEZE, autovacuum_vacuum_scale_factor, pg_stat_progress_vacuum, visibility map, parallel vacuumreferences/28-vacuum-autovacuum.mdVACUUM & autovacuum
transaction id wraparound, XID wraparound, datfrozenxid, autovacuum_freeze_max_age, MultiXact wraparound, 64-bit XIDreferences/29-transaction-id-wraparound.mdTXID wraparound
HOT update, heap-only tuple, n_tup_hot_upd, HOT chainreferences/30-hot-updates.mdHOT updates
TOAST, oversized attribute, storage strategy, PLAIN, EXTENDED, EXTERNAL, MAIN, pglz, lz4 compressionreferences/31-toast.mdTOAST
shared_buffers, buffer manager, clock sweep, bgwriter, pg_buffercache, ring bufferreferences/32-buffer-manager.mdBuffer manager
WAL, wal_level, full_page_writes, archive_command, archive_library, wal_compression, wal_segment_size, pg_waldumpreferences/33-wal.mdWrite-Ahead Log
checkpoint, checkpointer, checkpoint_timeout, max_wal_size, checkpoint_completion_target, bgwriter_lru_maxpages, pg_stat_checkpointerreferences/34-checkpoints-bgwriter.mdCheckpoints & bgwriter
partition, RANGE partition, LIST partition, HASH partition, partition pruning, ATTACH PARTITION, DETACH PARTITION, DEFAULT partition, partition-wise joinreferences/35-partitioning.mdDeclarative partitioning
inheritance, INHERITS, ONLY clausereferences/36-inheritance.mdTable inheritance
CHECK constraint, NOT NULL, UNIQUE, UNIQUE NULLS NOT DISTINCT, EXCLUDE constraint, NOT VALID, VALIDATE CONSTRAINT, deferrablereferences/37-constraints.mdConstraints
foreign key, FOREIGN KEY, REFERENCES, ON DELETE CASCADE, ON DELETE SET NULL, deferrable FK, partitioned FK, circular FKreferences/38-foreign-keys-deep.mdForeign keys
CREATE TRIGGER, BEFORE trigger, AFTER trigger, INSTEAD OF, FOR EACH ROW, FOR EACH STATEMENT, NEW, OLD, transition table, REFERENCING NEW TABLEreferences/39-triggers.mdTriggers
event trigger, CREATE EVENT TRIGGER, ddl_command_start, ddl_command_end, sql_drop, table_rewrite, pg_event_trigger_ddl_commandsreferences/40-event-triggers.mdEvent triggers
BEGIN, COMMIT, ROLLBACK, SAVEPOINT, subtransaction, PREPARE TRANSACTION, 2PC, idle_in_transaction_session_timeout, autocommitreferences/41-transactions.mdTransactions
Read Committed, Repeatable Read, Serializable, SSI, snapshot isolation, default_transaction_isolation, serialization failure, retry patternreferences/42-isolation-levels.mdIsolation levels
lock, FOR UPDATE, FOR NO KEY UPDATE, FOR SHARE, FOR KEY SHARE, NOWAIT, SKIP LOCKED, AccessExclusiveLock, RowExclusiveLock, pg_locks, pg_blocking_pids, deadlockreferences/43-locking.mdLocking
advisory lock, pg_advisory_lock, pg_advisory_xact_lock, pg_try_advisory_lockreferences/44-advisory-locks.mdAdvisory locks
LISTEN, NOTIFY, UNLISTEN, pg_notify, notification queuereferences/45-listen-notify.mdLISTEN/NOTIFY
CREATE ROLE, GRANT, REVOKE, ALTER DEFAULT PRIVILEGES, pg_read_all_data, pg_monitor, SET ROLE, REASSIGN OWNED, INHERIT, NOINHERIT, BYPASSRLSreferences/46-roles-privileges.mdRoles & privileges
row-level security, RLS, CREATE POLICY, USING, WITH CHECK, FORCE ROW LEVEL SECURITY, ENABLE ROW LEVEL SECURITYreferences/47-row-level-security.mdRow-Level Security
pg_hba.conf, authentication method, scram-sha-256, md5, peer, trust, ident, ldap, gss, cert authreferences/48-authentication-pg-hba.mdpg_hba.conf & auth
SSL, TLS, sslmode, verify-full, channel binding, server cert, client certificate, ssl_ciphersreferences/49-tls-ssl.mdTLS/SSL
pgcrypto, encrypt, decrypt, pgp_sym_encrypt, digest, crypt, gen_salt, TDEreferences/50-encryption-pgcrypto.mdpgcrypto
pgaudit, audit log, session auditing, object auditing, compliance loggingreferences/51-pgaudit.mdpgaudit
CREATE RULE, rule system, ON SELECT DO INSTEADreferences/52-rules-system.mdRule system
postgresql.conf, postgresql.auto.conf, GUC, pg_settings, ALTER SYSTEM, reload, pg_reload_conf, parameter contextreferences/53-server-configuration.mdConfiguration
shared_buffers, effective_cache_size, work_mem, hash_mem_multiplier, maintenance_work_mem, autovacuum_work_mem, temp_buffers, wal_buffers, huge_pagesreferences/54-memory-tuning.mdMemory tuning
ANALYZE, pg_statistic, pg_stats, default_statistics_target, extended statistics, CREATE STATISTICS, ndistinct, dependencies, MCVreferences/55-statistics-planner.mdStatistics & planner input
EXPLAIN, EXPLAIN ANALYZE, EXPLAIN (BUFFERS), Seq Scan, Index Scan, Index Only Scan, Bitmap Heap Scan, Nested Loop, Hash Join, Merge Join, Memoize, Gather, Append, row estimate, plan nodereferences/56-explain.mdEXPLAIN deep dive
pg_stat_statements, query stats, top queries, calls, mean_exec_time, shared_blks_hitreferences/57-pg-stat-statements.mdpg_stat_statements
pg_stat_activity, wait_event, pg_stat_user_tables, pg_stat_user_indexes, pg_stat_database, pg_stat_io, pg_stat_wal, pg_stat_progress_*, performance diagnosticsreferences/58-performance-diagnostics.mdpg_stat_* diagnostics
random_page_cost, seq_page_cost, cpu_tuple_cost, effective_io_concurrency, enable_seqscan, enable_hashjoin, join_collapse_limit, geqo, planner tuningreferences/59-planner-tuning.mdPlanner tuning
parallel query, max_parallel_workers, max_parallel_workers_per_gather, max_parallel_maintenance_workers, parallel append, parallel hash join, force_parallel_modereferences/60-parallel-query.mdParallel query
JIT, jit_above_cost, jit_inline_above_cost, LLVM, just-in-time compilationreferences/61-jit-compilation.mdJIT compilation
tablespace, CREATE TABLESPACE, default_tablespace, temp_tablespaces, SET TABLESPACEreferences/62-tablespaces.mdTablespaces
postmaster, backend process, autovacuum launcher, walwriter, walsender, walreceiver, archiver, bgwriter, checkpointer, logical replication worker, shared memory architecture, fork per connectionreferences/63-internals-architecture.mdProcess & memory architecture
pg_catalog, pg_class, pg_attribute, pg_index, pg_namespace, pg_constraint, pg_proc, pg_type, pg_depend, pg_inherits, pg_partitioned_table, pg_publication, pg_subscription, pg_extension, pg_authid, pg_roles, pg_database, pg_tablespace, pg_settings, relkind, information_schema, ECHO_HIDDEN, catalog explorationreferences/64-system-catalogs.mdSystem catalogs & exploration recipes
collation, ICU, libc, deterministic collation, nondeterministic collation, case-insensitive UNIQUE, collation version, encoding, UTF-8, client_encodingreferences/65-collations-encoding.mdCollations & encoding
COPY, \copy, bulk load, CSV import, HEADER, DELIMITER, FREEZE, ON_ERROR, LOG_VERBOSITY, parallel COPYreferences/66-bulk-operations-copy.mdCOPY / bulk
psql, \d, \dt, \di, \df, \dn, \dx, \timing, \watch, \gexec, pg_isready, createdb, dropdb, vacuumdb, reindexdb, clusterdbreferences/67-cli-tools.mdCLI tools
pgbench, benchmark, TPC-B, -c clients, -j threads, scaling factor, custom pgbench scriptreferences/68-pgbench.mdpgbench
CREATE EXTENSION, ALTER EXTENSION UPDATE, pg_extension, trusted extension, contribreferences/69-extensions.mdExtensions overview
FDW, foreign data wrapper, CREATE FOREIGN TABLE, postgres_fdw, file_fdw, IMPORT FOREIGN SCHEMA, dblink, pushdownreferences/70-fdw.mdFDW
large object, lo_create, lo_open, lo_read, lo_export, lo_import, pg_largeobject, vacuumlo, bytea vs LOreferences/71-large-objects.mdLarge objects
extension development, PGXS, PG_MODULE_MAGIC, PG_FUNCTION_INFO_V1, .control, hooks, C extensionreferences/72-extension-development.mdExtension development
streaming replication, primary_conninfo, primary_slot_name, standby.signal, recovery.signal, synchronous_standby_names, synchronous_commit, cascading replication, hot_standby_feedbackreferences/73-streaming-replication.mdStreaming replication
logical replication, CREATE PUBLICATION, CREATE SUBSCRIPTION, FOR ALL TABLES, FOR TABLES IN SCHEMA, row filter, column list, replication origin, DDL replication, two-phase decodingreferences/74-logical-replication.mdLogical replication
replication slot, pg_create_physical_replication_slot, pg_create_logical_replication_slot, max_slot_wal_keep_size, max_replication_slots, max_wal_senders, pg_replication_slots, slot invalidationreferences/75-replication-slots.mdReplication slots
logical decoding, pgoutput, wal2json, decoderbufs, test_decoding, CDC, REPLICA IDENTITY, START_REPLICATION SLOT LOGICALreferences/76-logical-decoding.mdLogical decoding
standby, hot standby, max_standby_streaming_delay, hot_standby_feedback, pg_promote, pg_rewind, timeline ID, failover, switchoverreferences/77-standby-failover.mdStandby & failover
HA, high availability, Patroni, repmgr, pg_auto_failover, Stolon, cluster manager, fencing, split brain, witnessreferences/78-ha-architectures.mdHA architectures
Patroni, patroni.yml, DCS, etcd, consul, zookeeper, REST API, /failover, /switchover, watchdogreferences/79-patroni.mdPatroni
connection pool, pool sizing, transaction pool, session pool, statement pool, process-per-connectionreferences/80-connection-pooling.mdConnection pooling concepts
pgBouncer, pool_mode, default_pool_size, reserve_pool_size, server_idle_timeout, prepared statement pgbouncer, SHOW POOLS, SHOW STATSreferences/81-pgbouncer.mdpgBouncer
monitoring, postgres_exporter, prometheus, pg_stat_*, alerting thresholds, log-based metricsreferences/82-monitoring.mdMonitoring
pg_dump, pg_dumpall, pg_restore, custom format, directory format, parallel dump, --filter, --on-conflict-do-nothingreferences/83-backup-pg-dump.mdLogical backup
pg_basebackup, base backup, archive_command, restore_command, recovery_target_time, recovery_target_xid, PITR, point-in-time recovery, continuous archivingreferences/84-backup-physical-pitr.mdPhysical backup & PITR
pgBackRest, Barman, WAL-G, incremental backup, retention policy, S3 backupreferences/85-backup-tools.mdBackup tooling
pg_upgrade, --link, --clone, major upgrade, statistics preservation, preflight checkreferences/86-pg-upgrade.mdpg_upgrade
major version upgrade, blue-green upgrade, logical replication upgrade, near-zero downtime, catalog versionreferences/87-major-version-upgrade.mdMajor-version upgrade strategy
corruption, data_checksums, pg_amcheck, pg_checksums, pg_resetwal, single-user mode, zero_damaged_pagesreferences/88-corruption-recovery.mdCorruption recovery
pg_rewind, divergent timeline, wal_log_hints, --source-server, --source-pgdatareferences/89-pg-rewind.mdpg_rewind
disaster recovery, RPO, RTO, DR drill, runbook, failover bookkeepingreferences/90-disaster-recovery.mdDisaster recovery
docker postgres, docker-entrypoint-initdb.d, POSTGRES_PASSWORD, healthcheck postgres container, volume PGDATAreferences/91-docker-postgres.mdDocker postgres image
Kubernetes postgres, CloudNativePG, CNPG, postgres-operator, Zalando, Crunchy PGO, StatefulSetreferences/92-kubernetes-operators.mdK8s operators
pg_trgm, trigram, similarity, % operator, GIN trigram, LIKE acceleration, word_similarityreferences/93-pg-trgm.mdpg_trgm
pgvector, vector, embedding, HNSW, IVFFLAT, <->, <=>, <#>, halfvec, sparsevec, m, ef_construction, ef_search, lists, probes, ANNreferences/94-pgvector.mdpgvector
PostGIS, geometry, geography, SRID, ST_Transform, ST_DWithin, ST_Intersects, ST_Buffer, spatial indexreferences/95-postgis.mdPostGIS
TimescaleDB, hypertable, continuous aggregate, compression, retention policy, chunkreferences/96-timescaledb.mdTimescaleDB
Citus, distributed table, reference table, coordinator, worker, shard, colocated join, columnar storagereferences/97-citus.mdCitus
pg_cron, cron.schedule, cron.job, cron.job_run_details, scheduled VACUUM, scheduled REFRESH MATERIALIZED VIEWreferences/98-pg-cron.mdpg_cron
pg_partman, partman.create_parent, run_maintenance_proc, partition retention, partman.part_config, sub-partitionreferences/99-pg-partman.mdpg_partman
PG14, PG15, PG16, PG17, PG18, release notes, version features, support policyreferences/100-pg-versions-features.mdPer-major-version feature highlights
managed Postgres, managed PaaS, hosted Postgres, bare-metal, self-hosted, superuser restriction, extension allowlist, shared_preload_libraries restriction, vendor lock-inreferences/101-managed-vs-baremetal.mdManaged vs bare-metal trade-offs (provider-agnostic)
recipe, cookbook, bloat triage, slow-query investigation, deadlock investigation, replication lag investigation, PITR walkthrough, upgrade playbook, catalog explorationreferences/102-skill-cookbook.mdMulti-file recipes & catalog exploration

Disambiguation Tips

Some terms route to multiple files — load both when in doubt.

TermPrimary fileSecondary fileWhy
VACUUM blocking28-vacuum-autovacuum.md27-mvcc-internals.md, 29-transaction-id-wraparound.mdWhy VACUUM exists is MVCC; what it must do is bounded by wraparound
EXPLAIN plan56-explain.md55-statistics-planner.md, 59-planner-tuning.mdMisestimates point to stats; tuning may need GUC changes
Index choice22-indexes-overview.md23-btree-indexes.md through 25-brin-hash-spgist-bloom-indexes.mdOverview routes to specifics
Deadlock43-locking.md42-isolation-levels.mdPredicate locks (SSI) cause different deadlocks
Replication is lagging73-streaming-replication.md75-replication-slots.md, 82-monitoring.mdLag could be stream pressure or slot retention
Upgrade86-pg-upgrade.md87-major-version-upgrade.mdpg_upgrade is one strategy; the other file covers blue/green and logical-repl-based upgrades
JSON column performance17-json-jsonb.md24-gin-gist-indexes.mdJSONB indexing happens via GIN
Full-text search ranking20-text-search.md24-gin-gist-indexes.mdFTS uses GIN
Bulk load slow66-bulk-operations-copy.md33-wal.md, 28-vacuum-autovacuum.mdWAL volume and post-load vacuum dominate
Catalog exploration / inspection64-system-catalogs.md102-skill-cookbook.mdThe cookbook has runnable recipes
shared_buffers32-buffer-manager.md54-memory-tuning.mdMechanics live in 32; sizing guidance lives in 54
work_mem / hash_mem_multiplier54-memory-tuning.md59-planner-tuning.md, 56-explain.mdSizing in 54; planner cost interaction in 59; spill-to-disk diagnosis in 56
archive_command / archive_library33-wal.md84-backup-physical-pitr.md, 85-backup-tools.mdWAL-level mechanics in 33; PITR consumer side in 84; pgBackRest/Barman/WAL-G in 85
wal_level33-wal.md74-logical-replication.md, 76-logical-decoding.mdSetting + implications in 33; logical consumers in 74/76
pg_basebackup84-backup-physical-pitr.md89-pg-rewind.md, 73-streaming-replication.mdBase backup in 84; rebuild-after-divergence alternative in 89; standby provisioning in 73
Partition rotation / retention35-partitioning.md99-pg-partman.md, 98-pg-cron.mdNative partitioning in 35; lifecycle automation in 99; scheduling in 98
Slow query56-explain.md57-pg-stat-statements.md, 58-performance-diagnostics.md, 55-statistics-planner.md, 102-skill-cookbook.mdWorkload-wide via 57; plan via 56; misestimate root cause in 55; full investigation walk in 102
Connection storm / too many connections80-connection-pooling.md81-pgbouncer.md, 63-internals-architecture.md, 46-roles-privileges.mdPooling concepts in 80; pgBouncer config in 81; fork-per-connection cost in 63; per-role connection limits in 46
Failover / promote77-standby-failover.md78-ha-architectures.md, 79-patroni.md, 89-pg-rewind.mdManual mechanics in 77; cluster-manager landscape in 78; Patroni-specific in 79; rejoin-old-primary in 89

Versioning & Provider Neutrality

  • Target compatibility baseline: every SQL example must run on PostgreSQL 16 unless explicitly marked otherwise.
  • Version-pin docs URLs. Cite https://www.postgresql.org/docs/16/..., not /docs/current/. The current alias moves with each annual release.
  • Provider neutrality is mandatory. Never recommend a managed provider over another. When discussing managed-service limitations, phrase categorically ("most managed providers disable untrusted PLs"), not by name.

Sources

Primary documentation roots (re-fetch before citing in any reference file; version-pin URLs to the matching major):

SKILL.md

tile.json