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
94%
Does it follow best practices?
Impact
94%
1.36xAverage score across 3 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent follows the PostgreSQL skill's performance investigation guidance: specifically recommending random_page_cost = 1.1 for NVMe/SSD storage, using EXPLAIN (ANALYZE, BUFFERS) for performance work, referencing pg_stat_statements for workload-wide analysis, using CREATE STATISTICS for correlated column misestimates, using pg_stats view (not pg_statistic), and including version-pinned documentation URLs.",
"type": "weighted_checklist",
"checklist": [
{
"name": "NVMe random_page_cost",
"description": "The recommendations include setting random_page_cost to approximately 1.1 (or a value significantly lower than the default 4.0) specifically because the storage is NVMe/SSD, NOT leaving it at the default",
"max_score": 15
},
{
"name": "EXPLAIN ANALYZE BUFFERS",
"description": "The diagnostic script or recommendations include EXPLAIN (ANALYZE, BUFFERS) — the parenthesized form with both ANALYZE and BUFFERS options — for plan inspection",
"max_score": 12
},
{
"name": "pg_stat_statements usage",
"description": "The diagnostic script queries pg_stat_statements to identify the slowest or most resource-intensive queries workload-wide",
"max_score": 10
},
{
"name": "CREATE STATISTICS recommendation",
"description": "The recommendations mention CREATE STATISTICS (with dependencies or mcv) for handling correlated multi-column predicates, not just ANALYZE alone",
"max_score": 15
},
{
"name": "pg_stats not pg_statistic",
"description": "Any column statistics queries use the pg_stats view and NOT pg_statistic directly",
"max_score": 8
},
{
"name": "pg_class filtered by relkind",
"description": "Any catalog queries against pg_class include a relkind filter (e.g., WHERE relkind IN ('r', 'p') or similar) to avoid mixing object types",
"max_score": 8
},
{
"name": "Version-pinned URLs",
"description": "Any official PostgreSQL documentation URLs use a pinned major version path (e.g., /docs/16/) and NOT /docs/current/",
"max_score": 10
},
{
"name": "PG16 baseline SQL",
"description": "SQL examples in the diagnostic script are written for PostgreSQL 16 compatibility (e.g., uses columns/functions available in PG16)",
"max_score": 7
},
{
"name": "EXPLAIN bottom-up reading",
"description": "The recommendations or findings document explains that EXPLAIN plans should be read bottom-up (leaves first, root last) or describes reading the plan tree from scan nodes upward",
"max_score": 8
},
{
"name": "Misestimate 10x threshold",
"description": "The findings document references detecting row count misestimates by comparing actual vs estimated rows (or mentions 10x divergence as a signal of a misestimate)",
"max_score": 7
}
]
}evals
references