PostgreSQL Field Guide

PostgreSQL extension selection guide

Choose PostgreSQL extensions for vector, GIS, time series, search, analytics, maintenance, and masking with explicit upgrade and cloud boundaries

PostgreSQL extensions can place types, indexes, planner hooks, background workers, and storage behavior inside the database process. They also enter the critical path for backup, replication, recovery, and major upgrades. The selection rule is simple: do not install an extension without a defined workload and exit path.

Six gates before installation

  1. The target PostgreSQL major, operating system, and CPU architecture have explicit support and packages.
  2. The license fits self-hosting, SaaS, redistribution, and commercial-feature boundaries.
  3. Backup, PITR, standbys, logical replication, and recovery environments can load the same version.
  4. pg_upgrade, extension update, and any required index rebuild have a rehearsed path.
  5. The managed-cloud region, SKU, and allowlist provide the required version, not merely an extension with the same name.
  6. An export or migration path exists without the extension, limiting accidental platform lock-in.

Record SELECT extname, extversion FROM pg_extension, and place extension versions beside the database version in deployment manifests and AI context.

First check native B-tree/GIN/GiST/SP-GiST/BRIN, full-text search, partitions, FDWs, and materialized views in PostgreSQL index and storage access methods. Add an extension only when native behavior fails a measured workload requirement.

Choose by workload

WorkloadCommon candidateAdoption boundary
SQL statisticspg_stat_statementsOfficial contrib and an observability baseline; govern query-text access
Vector search / RAGpgvectorMeasure recall, latency, memory, and index build with real filters
GeospatialPostGISStandard GIS choice; verify extension and data-format upgrades
Time seriesTimescaleDBEvaluate for hypertables, compression, or continuous aggregates; check licensing feature by feature
Distributed multi-tenancyCitusAdd only after measuring a single-node bottleneck and stabilizing a shard key
BM25 / searchParadeDB / pg_searchVerify license, index recovery, replication, and cloud support
In-PostgreSQL BM25pg_textsearchUpstream currently calls it production ready; independently validate target version and corpus
Embedded analytics / Parquetpg_duckdbFit for analytics paths; test transaction boundaries, resource isolation, and object-store credentials
Iceberg columnstore mirrorpg_mooncakeMaintains a columnstore mirror from logical changes; validate consistency, object storage, pg_duckdb dependency, and recovery
Graph queriesApache AGEAdopt only when a graph model and Cypher produce measured value

“Production ready” is an upstream project status, not a certification for your workload, SLA, or cloud platform.

Maintenance and data governance

ToolPurposeDo not mistake it for
HypoPGEvaluate planner choices with hypothetical indexesProof of build cost or production benefit
pg_repackReorganize tables and indexes with shorter exclusive-lock windowsA replacement for routine autovacuum
pg_partmanManage native time/serial partition lifecyclesAn automatic fix for a poor partition key
pg_cronSchedule simple SQL inside PostgreSQLA general business queue or workflow engine
GreenmaskProduce masked and subsetted test dataPermission to copy sensitive production data without review
PostgreSQL AnonymizerDeclarative static and dynamic maskingAutomatic compliance with every requirement

For severe bloat, first find long transactions, autovacuum, write patterns, and fillfactor causes before using pg_repack. Partitioning helps only where lifecycle and queries can use the partition key.

PostgreSQL 19 REPACK is not pg_repack

The core REPACK in PostgreSQL 19 Beta is a new SQL command. REPACK (CONCURRENTLY) uses logical decoding and has constraints around primary keys or replica identity, unlogged/partitioned/system tables, replication slots, and disk space.

Third-party pg_repack is an independent extension and command-line tool with its own compatibility matrix, packages, and operational boundaries. Similar names do not make pg_repack experience, monitoring, or risks directly transferable to core PostgreSQL 19 REPACK.

A Beta feature is not a production dependency

As of 2026-08-02, PostgreSQL 19 remains Beta 2. Validate core REPACK semantics and constraints against final GA documentation and a restored copy of your own data.

AI, backup, and upgrade checklist

Provide AI agents with server_version_num, extname/extversion, allowed operators and index methods, cloud limitations, and forbidden syntax. “This is PostgreSQL” is insufficient context.

Before every extension upgrade:

  1. Read target release notes, SQL update scripts, and known rebuild requirements.
  2. Restore a real backup into an isolated environment.
  3. Upgrade PostgreSQL and the extension, then run integrity, performance, and RLS tests.
  4. Rebuild required indexes and compare plans, recall, or business results.
  5. Create a new backup and restore it once to prove the new-version chain.

Supabase, Neon, YugabyteDB, CockroachDB, Cloudberry, Gel, and FerretDB do not belong in an extension ranking. They are platforms, forks, independent databases, or protocol translation layers; classify them with PostgreSQL lineage and compatible databases.

Last updated on

On this page