PIG Package Manager

PostgreSQL Extension Ecosystem Package Manager

Postgres Install Genius, the missing extension package manager for the PostgreSQL ecosystem

PIG is a command-line tool specifically designed for installing, managing, and building PostgreSQL and its extensions. Developed in Go, it is ready to use out of the box, simple, and lightweight (4MB). PIG is not a reinvented wheel, but rather a PiggyBack - a high-level abstraction layer that leverages existing Linux distribution package managers (apt/dnf). It abstracts away the differences between operating systems, chip architectures, and PG major versions, allowing you to install and manage PG kernels and 444+ extensions with just a few simple commands.

PIG is also automation-friendly by design: consistent parameter styles, clear error messages, and safe guards like --dry-run for high-risk operations.

Please note: for extension installation, pig is not a mandatory component. You can still use apt/dnf package managers to directly access the Pigsty PGSQL repository.

Quick Start

Use the following command to install PIG on your system:

Default Installation (Cloudflare CDN):

curl -fsSL https://repo.pigsty.io/pig | bash

China Mirror:

curl -fsSL https://repo.pigsty.cc/pig | bash

After installation, you can get started with just a few commands. For example, to install PG 18 and the pg_duckdb extension:

$ pig repo set                        # One-time setup for Linux, Pigsty + PGDG repos (overwrites!)
$ pig install pg18                    # Install PostgreSQL 18 kernel (native PGDG packages)
$ pig install pg_duckdb -v 18         # Install pg_duckdb extension (for PG 18)
$ pig install -y postgis timescaledb  # Install multiple extensions for current active PG version
$ pig install -y vector               # You can use extension name (vector) or package name (pgvector)!

Command Reference

Run pig help <command> to get detailed help for subcommands.

Extension Management:

Pigsty Management:

About

The pig CLI tool is developed by Vonng ([email protected]) and is open-sourced under the Apache 2.0 license.

You can also check out the PIGSTY project, which provides a complete PostgreSQL RDS DBaaS experience including extension delivery.

  • PGEXT: Extension data and management tools
  • PIG: PostgreSQL package manager
  • PIGSTY: Batteries-included PostgreSQL distribution

Getting Started

Quick start with pig, the PostgreSQL package manager

Introduction

Why do we need yet another package manager? Especially for Postgres extensions?

Installation

How to download and install the pig package manager

Release

pig — PostgreSQL Package Manager Release Notes

pig

pig CLI command reference overview

pig repo

Manage software repositories with pig repo subcommand

pig ext

Manage PostgreSQL extensions with pig ext subcommand

pig build

Build PostgreSQL extensions from source with pig build subcommand

pig sty

Manage Pigsty installation with pig sty subcommand

pig postgres

Manage local PostgreSQL server with pig postgres subcommand

pig patroni

Manage Patroni service and cluster with pig patroni subcommand

pig pgbackrest

Manage pgBackRest backup and PITR with pig pgbackrest subcommand

pig pitr

Perform orchestrated Point-In-Time Recovery (PITR) with pig pitr command