logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·02.11.26
← Back to news

Show HN: Pglayers – PostgreSQL extensions as stackable Docker layers

Original article
github.com|8 points|1 comments|by iemejia|Jul 1, 2026

🚀 Pglayers: Composable PostgreSQL Extensions via Docker Layers

Pglayers transforms how you handle PostgreSQL extensions. Instead of wrestling with complex build environments, it provides a system where extensions are treated as stackable Docker layers.

Check it out on GitHub: pglayers/pglayers


🛠️ The Problem & The Solution

The official PostgreSQL Docker images are lean, meaning they ship without any extensions. Traditionally, if you needed pgvector, PostGIS, or pg_cron, you were forced to:

  • Manually install system dependencies
  • Compile source code from scratch
  • Rely on bloated third-party images with rigid, pre-defined extension sets

Pglayers solves this by offering a ready-to-use distribution and a toolkit to assemble your own custom image. It sits directly on top of the official postgres images, removing the need for you to manage compilers or build logic.

How it Works: The Layering Concept

Each extension is packaged as a lightweight Docker image containing only the necessary binaries. You simply "stack" these layers using the COPY --from instruction.

Mathematically, the final image Imfinal\text{Im}_{final}Imfinal​ can be represented as the sum of the base image and the selected extension layers: Imfinal=Impostgres+∑i=1nLayerext_i\text{Im}_{final} = \text{Im}_{postgres} + \sum_{i=1}^{n} \text{Layer}_{ext\_i}Imfinal​=Impostgres​+∑i=1n​Layerext_i​


🚀 Quick Start Guide

Depending on your needs, you can choose between pre-configured bundles or a bespoke setup.

Option 1: Ready-to-Use Images

These images come with shared_preload_libraries already configured for convenience.

  • Full Suite: Includes all 53 available extensions.
  • Azure Profile: Compatible with Azure Database for PostgreSQL (28 extensions).

Deployment Commands:

# Launch the full version (PG 17)
docker run -d -e POSTGRES_PASSWORD=secret ghcr.io/pglayers/pglayers-full:17

# Launch the Azure-compatible version (PG 17)
docker run -d -e POSTGRES_PASSWORD=secret ghcr.io/pglayers/pglayers-azure:17

[!IMPORTANT] Note on Vendor Profiles: Profiles like azure are best-effort approximations intended for local development. They are not exact replicas of managed services; differences in configuration defaults, versions, and platform behavior may exist. Use them for testing, not for mirroring production perfectly.

Option 2: Custom Composition

If you want a lean image, pick only the extensions you actually need.

Example Dockerfile:

FROM postgres:17

# Stack only the required extensions
COPY --from=ghcr.io/pglayers/pgx-pgvector:17 / /
COPY --from=ghcr.io/pglayers/pgx-pg_cron:17 / /
COPY --from=ghcr.io/pglayers/pgx-postgis:17 / /

Build and Execute:

  1. docker build -t my-postgres .
  2. docker run -d -e POSTGRES_PASSWORD=secret my-postgres

Since the layers are pre-built, no compilation occurs during the build process.


📊 Compatibility & Support

Docker Logo (Example representation of the containerization approach)

PostgreSQL Version Status

VersionStatusNotes
PostgreSQL 17StableFully tested and supported
PostgreSQL 18StableFully tested and supported
PostgreSQL 19ExperimentalBeta support; some extensions may lack upstream compatibility

📚 Available Extension Catalog

Below is the comprehensive list of extensions provided by Pglayers.

ExtensionVersionPG VersionsDescription
age1.7.0-rc017, 18Apache AGE: Graph DB with openCypher
anon3.1.117, 18Data masking and anonymization
credcheck5.017, 18, 19User creation/password change credential checks
documentdb0.113-017, 18MongoDB-compatible engine (BSON/CRUD)
h3-pg4.2.317, 18Uber H3 hexagonal geospatial indexing
hll2.2117, 18, 19HyperLogLog for probabilistic counting
http1.7.117, 18, 19SQL-based HTTP client
hypopg1.4.317, 18, 19Hypothetical indexes for "what-if" analysis
ip4r2.4.317, 18, 19IPv4/IPv6 range types with GiST
orafce4.16.717, 18, 19Oracle compatibility layer
pgaudit17.117, 18Session and object-level audit logging
pg_bigm1.217, 182-gram search (optimized for CJK)
pg_cron1.6.717, 18Internal database job scheduler
pg_duckdb1.1.117, 18Embedded DuckDB columnar analytics
pg_durable0.2.317, 18Fault-tolerant in-database workflows
pg_failover_slots1.2.117, 18Logical replication slot manager for failover
pg_graphql1.6.117, 18GraphQL interface for Postgres
pg_hashids1.2.117, 18, 19Integer to short unique hash IDs
pg_hint_plan1.7.117, 18SQL comment-based execution plan hints
pg_ivm1.1317, 18Incremental View Maintenance
pg_jsonschema0.3.417, 18JSON Schema validation
pg_net0.20.317, 18, 19Async non-blocking HTTP/HTTPS requests
pg_partman5.4.317, 18, 19Automated table partitioning
pg_qualstats2.1.417, 18, 19WHERE clause predicate statistics
pg_repack1.5.317, 18, 19Online table reorganization (low lock)
pg_roaringbitmap1.1.017, 18Fast set operations via Roaring bitmaps
pg_similarity1.017, 18Levenshtein, Jaro-Winkler, Cosine, Jaccard
pg_squeeze1.9.317, 18, 19Table space reclamation (low lock)