pig ext
The pig ext command searches the extension catalog and manages PostgreSQL extension packages on a host. It can resolve names, inspect package availability, install/remove/update RPM or DEB packages, and handle PostgreSQL kernel packages. Database-local activation and migration are deliberately outside this command group’s scope.
| Command | Description | Notes |
|---|---|---|
ext list |
Search extensions | |
ext info |
Show extension details | |
ext avail |
Show extension availability matrix | |
ext status |
Show host-visible extension files/packages | Does not query every database |
ext scan |
Scan installed control/library files | Does not query every database |
ext add |
Install extensions | Requires sudo or root |
ext rm |
Remove extensions | Requires sudo or root |
ext update |
Update extensions | Requires sudo or root |
ext import |
Download extensions for offline use | Requires sudo or root |
ext link |
Link a PG version into PATH | Requires sudo or root |
ext reload |
Refresh extension catalog |
Quick Start
Before installing PostgreSQL extensions, add the required repositories with pig repo add:
Then search and install PostgreSQL extensions:
See the extension list for available extensions and package names.
Notes:
- If no PostgreSQL version is specified, pig tries to detect the active PostgreSQL installation from
pg_configinPATH. - PostgreSQL can be selected by major version (
-v) or by pg_config path (-p).- With
-v, pig uses the default PGDG kernel package path for that major version.- EL distros:
/usr/pgsql-$v/bin/pg_config - DEB distros:
/usr/lib/postgresql/$v/bin/pg_config
- EL distros:
- With
-p, pig locates PostgreSQL directly from that path.
- With
- The extension manager automatically adapts to the OS package format:
- RPM packages for RHEL/CentOS/Rocky Linux/AlmaLinux
- DEB packages for Debian/Ubuntu
- Extension dependencies are resolved automatically when possible.
- Use
-ycarefully because it auto-confirms prompts.
Pigsty assumes official PGDG kernel packages are installed. If not, install them with:
Package Layer vs Database Layer
PIG operates primarily at the operating-system package layer. This distinction prevents several common but dangerous assumptions:
| Command | What it changes | What it does not do |
|---|---|---|
ext add |
Installs selected RPM/DEB packages and their package dependencies | Run CREATE EXTENSION, edit PostgreSQL settings, or restart PostgreSQL |
ext rm |
Removes selected RPM/DEB packages | Run DROP EXTENSION or check every database that may still depend on their files |
ext update |
Upgrades explicitly named OS packages | Run ALTER EXTENSION UPDATE or migrate extension-owned database objects |
ext status / ext scan |
Inspects the selected PostgreSQL installation tree and host-visible files | Prove that an extension is created, healthy, or at a particular SQL version in every database |
ext reload |
Downloads a newer catalog to ~/.pig/extension.csv |
Install or upgrade any package or database extension |
After a package transaction, use pig ext info NAME to review preload and DDL hints. Then apply configuration and SQL to each intended database, restart or reload PostgreSQL when the extension requires it, and verify pg_available_extensions / pg_extension plus the extension’s own upgrade documentation. Package removal should be preceded by a database dependency audit; removing shared files while database objects still exist can leave those databases unusable.
ext list
List or search extensions in the extension catalog.
Category filtering is done by passing the category name as the query. Supported categories include: time, gis, rag, fts, olap, feat, lang, type, func, util, admin, stat, sec, fdw, sim, and etl.
Options:
-v|--version: filter by PG version--pkg: show package names instead of extension names, listing only leading extensions
Status column:
installed: extension is installedavailable: extension is available but not installednot avail: extension is not available on the current system
The default extension catalog is defined in cli/ext/assets/extension.csv.
Use pig ext reload to refresh to the latest catalog. The downloaded catalog is stored at ~/.pig/extension.csv; the latest online catalog is also published at repo.pigsty.io/ext/data/extension.csv.
ext info
Show detailed information for selected extensions.
ext avail
Show the extension availability matrix across operating systems, architectures, and PostgreSQL versions.
The matrix shows availability across operating systems (EL8/9/10, Debian 12/13, Ubuntu 22/24/26), architectures (x86_64/aarch64), and PostgreSQL versions (14-18).
ext status
Show extension files/packages visible to the selected PostgreSQL installation on this host.
Options:
-c|--contrib: include contrib extensions in the result
ext scan
Scan the selected PostgreSQL installation’s extension directories.
This command scans PostgreSQL control files and related installation paths. It reports host-level availability; it does not connect to every database or inspect each database’s pg_extension catalog.
ext add
Install one or more PostgreSQL extensions. Same-level aliases for pig ext add include pig ext install, pig ext ins, and pig ext a. The top-level pig install command is a separate native package-manager wrapper that also supports PostgreSQL and extension alias translation.
Options:
-v|--version: specify PG major version-y|--yes: auto-confirm installation--plan: preview the install plan without running package-manager commands
Successful installation only makes the extension files available on the host. Follow the extension’s ext info hints for preload, restart, and CREATE EXTENSION steps.
ext rm
Remove one or more PostgreSQL extensions.
Options:
-v|--version: specify PG major version-y|--yes: auto-confirm removal--plan: preview the remove plan without running package-manager commands
This removes an OS package, not database objects. Drop or migrate dependent extensions in every affected database before removing the shared files.
ext update
Update explicitly selected installed extensions to the latest version. For safety, pig ext update with no arguments is a no-op; you must name the targets explicitly.
Options:
-v|--version: specify PG major version-y|--yes: auto-confirm update-m|--mirror: prefer thepigsty.ccmirror as the update source
The command does not run SQL migrations. After the package upgrade, follow the extension’s release notes and run ALTER EXTENSION ... UPDATE in each database where appropriate.
ext import
Download extension packages into a local repository for offline installation.
Options:
-d|--repo: local repository directory (default:/www/pigsty)
ext link
Link a selected PG version into the system PATH.
This command creates the /usr/pgsql symlink and writes /etc/profile.d/pgsql.sh.
ext reload
Refresh extension metadata.
The updated catalog is stored at ~/.pig/extension.csv.