pgextwlist

A sudo model for PostgreSQL extensions

pgextwlist lets cloud providers and hosting platforms safely offer PostgreSQL extension installation to non-superuser tenants, using a whitelist and privilege-elevation model.

What pgextwlist does

Controlled privilege elevation for extension management

pgextwlist intercepts CREATE EXTENSION statements and runs whitelisted ones under superuser privileges, dropping those privileges before returning control to the caller — so tenants get the extensions they need without ever holding superuser access.

Why it matters

Superuser is required, but cannot be granted

  • PostgreSQL requires superuser to install most C-coded extensions
  • Cloud tenants cannot be given superuser access
  • Without a solution, extensions like PostGIS or pgcrypto are simply unavailable
  • pgextwlist bridges the gap without compromising database security

Typical use cases

Where pgextwlist fits

  • Managed PostgreSQL offerings (Heroku, Aiven, Zalando Spilo, Azure Database for PostgreSQL)
  • Kubernetes-based Postgres operators
  • Multi-tenant SaaS platforms
  • Private clouds where DBA and tenant roles are separate

Key capabilities

Fine-grained control over extension lifecycle

  • Per-server or per-role whitelist via extwlist.extensions
  • Covers CREATE, DROP, ALTER UPDATE, COMMENT ON EXTENSION
  • Custom SQL scripts run before/after each operation
  • Supports PostgreSQL 10 through 18
  • Packaged for Debian, Ubuntu, and RPM distributions

Current focus

Active maintenance areas

Current work focuses on PostgreSQL major-version compatibility (CI on PG 10–18), custom scripts documentation, and packaging for current Debian and RPM targets.

How maintenance works

Queue, SLA, quarterly releases

Work is prioritized through a queue. Supported users receive priority handling, with defined response times. Fixes and improvements are grouped and shipped in quarterly releases.

Get pgextwlist

Open source and available now

pgextwlist is open source and developed in public. Load it via local_preload_libraries and configure the whitelist with extwlist.extensions.

Support pgextwlist

Keep extension whitelisting reliable

If pgextwlist is part of your managed PostgreSQL stack, supporting its maintenance ensures continued PostgreSQL version compatibility, faster bug fixes, and long-term reliability for your tenants.

Get the most out of PostgreSQL in production

Sharpen your skills, improve reliability, move faster

If you run PostgreSQL in production, the difference is not just tooling—it's how well you use it. Query design, data modeling, migrations, and performance tuning directly impact reliability and delivery speed.

The Art of PostgreSQL offers a complete, structured program to help you level up: from fundamentals to advanced production patterns, with practical, hands-on material you can apply immediately.