Once we have the catalog and repository, extension delivery is almost solved. You can use the OS package manager — `dnf` or `apt` — to install directly from the PGDG and PGEXT repos. We also have a dedicated but purely optional command-line tool — called PIG, written in Go, 4 megabytes. The name means "piggyback on the OS package manager." It hides all the complexity and just does the installation for users. The interesting part is that it doesn't just install — it can also build and deliver binary packages. If you want pg_search or pg_duckdb, just run `pig build pkg pg_search`, and it builds the package for you. This matters for supply-chain trust. Users can rebuild everything themselves if they want to. So that's the delivery layer — catalog, repository, CLI, and the build matrix behind them. On paper, it looks clean. In practice, the matrix is where things get hard.

Part III : The Delivery Layer

The CLI - PIG

PIGSTY
$ pig build Build Postgres Extension
Usagepig build [command]
Aliasesbuild, b
Examplepig build - Build Postgres Extension

Environment Setup

# init build spec and directory (~ext)pig build spec
# init build repo (=repo set -ru)pig build repo
# init build toolsetpig build tool [mini|full|...]
# install Rust toolchainpig build rust [-y]
# install and init pgrx (0.18.0)pig build pgrx [-v <ver>]
# init build proxy (optional)pig build proxy [id@host:port]

Package Building

# complete pipeline: get + dep + extpig build pkg [ext|pkg...]
# download extension source tarballpig build get [ext|pkg...]
# install extension build dependenciespig build dep [ext|pkg...]
# build extension packagepig build ext [ext|pkg...]

Quick Start

# setup build spec and directorypig build spec
# build citus extensionpig build pkg citus