I gave a presentation at PGConf.dev last week, Adventures in Extension Packaging. It summarizes stuff I learned in the past year in developing the PGXN Meta v2 RFC, re-packaging all of the extensions on pgt.dev, and experimenting with the CloudNativePG community’s proposal to mount extension OCI images in immutable PostgreSQL containers.
Turns out a ton of work and experimentation remains to be done.
I’ll post the link to the video once it goes up, but in meantime, here are the slides:
Previous work covers the first half of the talk, including:
- A brief introduction to PGXN, borrowing from the State of the Extensions Ecosystem
- The metadata designed to enable automated packaging of extensions added to the PGXN Meta v2 RFC
- The Trunk Packaging Format, a.k.a., PGXN RFC 2
- OCI distribution of Trunk packages
The rest of the talk encompasses newer work. Read on for details.
Automated Packaging Challenges
Back in December I took over maintenance of the Trunk registry, a.k.a., pgt.dev, refactoring and upgrading all 200+ extensions and adding Postgres 17 builds. This experience opened my eyes to the wide variety of extension build patterns and configurations, even when supporting a single OS (Ubuntu 22.04 “Jammy”). Some examples:
-
pglogical requires an extra
make
param to build on PostgreSQL 17:make -C LDFLAGS_EX="-L/usr/lib/postgresql/17/lib"
- Some pgrx extensions require additional params, for example:
-
pg_search needs the
--features
flag to enable icu -
vectorscale requires the environment variable
RUSTFLAGS="-C target-feature=+avx2,+fma"
-
pg_search needs the
-
pljava needs a pointer to
libjvm
:mvn clean install -Dpljava.libjvmdefault=/usr/lib/x86_64-linux-gnu/libjvm.so
- plrust needs files to be moved arou