Introduction
PIG is a command-line tool for installing and managing PostgreSQL and its extensions. It maps extension names to RPM or DEB packages and uses apt, dnf, or yum to install them.
The catalog contains 603 extension entries. PIG selects package names for your PostgreSQL major version, operating system, and CPU architecture. It also provides commands for source builds, local PostgreSQL operations, backups, and Pigsty administration.
What you can do
| Task | Command | Reference |
|---|---|---|
| Find an extension and check package availability | pig ext list, pig ext avail | Extensions |
| Add PGDG and Pigsty repositories | pig repo add pgsql -u | Repositories |
| Install PostgreSQL 18 and pgvector | pig install -v 18 pg18 vector | Getting started |
| Build an extension package from source | pig build pkg NAME | Build |
| Start, inspect, or stop a local PostgreSQL instance | pig pg | PostgreSQL |
| Manage a Patroni cluster | pig pt | Patroni |
| Back up or restore an instance | pig pb, pig pitr | pgBackRest, PITR |
| Configure Pigsty and run its playbooks | pig sty, pig inventory, pig do | Pigsty |
Start with the tutorial to install PostgreSQL and enable your first extension.
How package installation works
For example, this command installs pgvector for PostgreSQL 18:
PIG resolves vector to pgvector_18 on EL or postgresql-18-pgvector on Debian and Ubuntu. The system package manager resolves dependencies and installs the files.
To enable the extension, connect to the intended database and run:
Some extensions also need a setting in shared_preload_libraries and a PostgreSQL restart. Use pig ext info NAME to check these requirements. See package and database operations for updates and removal.
PIG is needed only when you run its commands. PostgreSQL and installed extensions continue to work without it. You can also use the Pigsty repositories directly with apt or dnf.
Linux compatibility
The package repositories cover PostgreSQL 14–18 on these Linux releases. Each release has packages for x86_64 and aarch64.
| OS code | Distribution | Release |
|---|---|---|
el8 | RHEL, Rocky Linux, AlmaLinux | 8 |
el9 | RHEL, Rocky Linux, AlmaLinux | 9 |
el10 | RHEL, Rocky Linux, AlmaLinux | 10 |
d12 | Debian | 12 |
d13 | Debian | 13 |
u22 | Ubuntu | 22.04 LTS |
u24 | Ubuntu | 24.04 LTS |
u26 | Ubuntu | 26.04 LTS |
Package availability varies by extension and target. On the target host, run:
The 603 catalog entries include packaged SQL utilities and retained records for removed extensions. The website and CLI use this same catalog-entry count. Check the entry’s status and availability before selecting a package. EL 7 and Debian 11 are outside the current package matrix.
The macOS binary supports catalog queries and commands such as inventory editing. PostgreSQL package installation uses Linux package managers. See Installation for the binary downloads.
Choose a workflow
- Use an existing host: add repositories with
pig repo add pgsql -u, then install the required packages. - Configure all repositories on a new host: use
pig repo set. It backs up and replaces the existing repository definitions. - Build a package: prepare a build host and use the maintained specifications with
pig build. - Prepare an offline installation: collect packages with
pig ext import, index them withpig repo create, and archive them withpig repo cache. See offline repositories. - Write a script or agent workflow: inspect
pig -o json --helpand use the supported output and plan options in the command reference.
The Design Records explain the main implementation decisions. The release notes describe changes in each published version.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)