Skip to content

Introduction

What PIG does, how package installation works, and which platforms it supports

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

TaskCommandReference
Find an extension and check package availabilitypig ext list, pig ext availExtensions
Add PGDG and Pigsty repositoriespig repo add pgsql -uRepositories
Install PostgreSQL 18 and pgvectorpig install -v 18 pg18 vectorGetting started
Build an extension package from sourcepig build pkg NAMEBuild
Start, inspect, or stop a local PostgreSQL instancepig pgPostgreSQL
Manage a Patroni clusterpig ptPatroni
Back up or restore an instancepig pb, pig pitrpgBackRest, PITR
Configure Pigsty and run its playbookspig sty, pig inventory, pig doPigsty

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:

sudo pig install vector -v 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:

CREATE EXTENSION vector;

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 codeDistributionRelease
el8RHEL, Rocky Linux, AlmaLinux8
el9RHEL, Rocky Linux, AlmaLinux9
el10RHEL, Rocky Linux, AlmaLinux10
d12Debian12
d13Debian13
u22Ubuntu22.04 LTS
u24Ubuntu24.04 LTS
u26Ubuntu26.04 LTS

Package availability varies by extension and target. On the target host, run:

pig ext avail vector

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 with pig repo create, and archive them with pig repo cache. See offline repositories.
  • Write a script or agent workflow: inspect pig -o json --help and 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?