pig ext
pig ext searches the extension catalog and installs, updates, or removes PostgreSQL extension packages on the host. It also supports PostgreSQL server packages. After installing a package, apply the SQL and configuration required by the extension.
| 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
This example uses a running PostgreSQL 18 instance. To install and start one, follow Getting Started.
Add the PostgreSQL repositories, inspect the extension, then install its package:
Enable the extension in the target database. For example:
See the extension list for other extensions.
If an extension requires preloading or other configuration, complete the steps from pig ext info NAME before enabling it.
Select a PostgreSQL installation
-v, --version 18: select a PostgreSQL major version.-p, --path /path/to/pg_config: select an installation by itspg_configpath.- Use one option at a time. When neither is supplied, PIG attempts local PostgreSQL detection. Set
-vexplicitly in automation.
The default PGDG paths are /usr/pgsql-18/bin/pg_config on EL and /usr/lib/postgresql/18/bin/pg_config on Debian/Ubuntu. The package manager resolves RPM/DEB dependencies. -y confirms package operations automatically.
Package and database operations
| Task | PIG operation | Database operation |
|---|---|---|
| Install | ext add NAME | Configure preloading if required, then run CREATE EXTENSION |
| Upgrade | ext update NAME | Follow the extension’s upgrade instructions and run ALTER EXTENSION ... UPDATE |
| Remove | ext rm NAME | Remove or migrate dependencies in affected databases before uninstalling the package |
| Inspect | ext status / ext scan inspect host files | Query pg_extension for enabled database extensions |
| Refresh catalog | ext reload updates extension metadata | None |
pg_available_extensions lists extensions available to the server. pg_extension lists extensions enabled in the current database.
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: select the PG version used to evaluate availability; unavailable entries remain in the list--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
Availability and text/JSON/YAML summaries use the same platform, architecture, and PostgreSQL
version. For platforms covered by a package matrix, that matrix takes precedence; a missing cell
is unavailable. Catalog entries without a matrix retain RPM/DEB metadata and platform-exception
fallbacks. amd64/x86_64 and arm64/aarch64 are equivalent. On macOS, this status describes
declared PostgreSQL version support, not the availability of an RPM/DEB package.
Catalog count
The website and CLI count every catalog record, including packaged SQL utilities such as pg_relation_sql and retained records for removed extensions. The bundled catalog currently contains 603 entries. This total does not mean that every entry supports CREATE EXTENSION or is available on every platform.
The unfiltered list includes every record. Its text row count and JSON/YAML data.count describe the rows returned; a search counts its matches, and --pkg counts leading package records. The global ext avail text summary uses the full catalog total. ext reload reports the number of records in the downloaded catalog through data.extension_count.
The counting decision explains this shared definition. 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.
The command reads control files and related installation paths for the selected PostgreSQL installation.
It also matches shared-library names against catalog metadata, so a catalog entry without a
control file can still be reported as installed. This does not imply CREATE EXTENSION support.
ext add
Install one or more PostgreSQL extensions. Aliases for pig ext add include pig ext install, pig ext ins, and pig ext a. The top-level pig install command also accepts extension aliases and general OS packages.
Use these aliases to select a PostgreSQL package group:
| Alias | Packages |
|---|---|
pg18 | Server, client, contrib modules, and procedural languages |
pg18-server | Server and contrib modules |
pg18-client | Client tools |
pg18-devel | Development files |
pg18-basic | pg_repack, wal2json, and pgvector |
Replace 18 with the required major version. You can also use pgsql with -v 18.
To select a specific package version, use NAME=VERSION with a version available in the configured repository.
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 the named packages to the versions available from the configured repositories. With no arguments, the command makes no changes.
Options:
-v|--version: specify PG major version-y|--yes: auto-confirm update-m|--mirror: refresh the extension catalog from thepigsty.ccmirror before updating packages; package downloads still use the configured OS repositories
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)
If some names cannot be resolved, successfully resolved packages are still downloaded, but the
command exits with failure. Structured output preserves requested, resolved packages,
confirmed downloaded packages, and unresolved failed names. A native download failure can
also leave files in the destination; it does not imply rollback or a complete download.
On Debian/Ubuntu, virtual dependency markers such as <virtual-package> are excluded from
the package download list; real package dependencies remain eligible.
JSON/YAML output and PIG_NON_INTERACTIVE=1 use non-interactive sudo. If privilege escalation
requires a password, the command fails instead of waiting for input; configure suitable sudo access first.
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. Load the profile in your current shell:
ext reload
Refresh extension metadata.
The updated catalog is stored at ~/.pig/extension.csv.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)