# PIG Documentation

> Install, manage, and build PostgreSQL and its extensions with the pig CLI.

---

LLMS index: [llms.txt](/v1.11/llms.txt)

---

Documentation version: **v1.11.0**. This release aligns with Pigsty **v4.6.0**, hardens package and operational command safety, adds ordered `sty conf` template shorthand lookup, and updates the embedded catalog to **625 entries**. Read the [release notes](/release/pig-1.11.0/).

PIG provides commands to find, install, and build PostgreSQL extension packages. It also manages PostgreSQL, Patroni, pgBackRest, and Pigsty workflows. Package installation uses the system's `apt`, `dnf`, or `yum`.

## Start here {#start-here}

| Your task | Page |
|:---|:---|
| Install PostgreSQL and enable your first extension | [Getting started](/v1.11/start/) |
| Learn what PIG does and which platforms it supports | [Introduction](/v1.11/intro/) |
| Download, install, update, or remove PIG | [Installation](/v1.11/install/) |
| Look up commands, options, and automation features | [Command reference](/v1.11/cmd/) |

## Install PostgreSQL and extensions {#install-postgresql-and-extensions}

On a Linux host with root or `sudo` access, run:

```bash
curl -fsSL https://repo.pigsty.io/pig | bash -s 1.11.0
sudo pig repo add pgsql --update
sudo pig install -v 18 pg18 vector
```

In mainland China, use `https://repo.pigsty.cc/pig` for the installer. These commands install PostgreSQL 18 and pgvector packages. Continue with [Getting started](/v1.11/start/) to start a test instance and enable the extension with `CREATE EXTENSION vector`.

## Command reference {#command-reference}

| Task | Command |
|:---|:---|
| Configure APT/DNF repositories | [`pig repo`](/v1.11/repo/) |
| Query the catalog, install, or update extension packages | [`pig ext`](/v1.11/ext/), [`pig install`](/v1.11/cmd/#pig-install) |
| Build extension packages from source | [`pig build`](/v1.11/build/) |
| Manage local PostgreSQL instances and databases | [`pig pg`](/v1.11/pg/) |
| Manage Patroni clusters through patronictl | [`pig pt`](/v1.11/pt/) |
| Inspect or reload pg_exporter | [`pig pe`](/v1.11/pe/) |
| Back up and restore with pgBackRest | [`pig pb`](/v1.11/pb/) |
| Run point-in-time recovery | [`pig pitr`](/v1.11/pitr/) |
| Install and configure Pigsty, manage Grafana | [`pig sty`](/v1.11/sty/) |
| Read, edit, and validate Pigsty inventory | [`pig inventory`](/v1.11/inventory/) |
| Run Pigsty administration playbooks | [`pig do`](/v1.11/do/) |
| Collect host, database, and backup status | [`pig context`](/v1.11/cmd/#pig-context) |
{.wide .expand}

Run `pig help <command>` for command help. For automation, use `pig -o json --help` to inspect command capabilities, then select the relevant output and plan options.

## Find more information {#find-more-information}

Press Ctrl + K (⌘ + K on macOS) to search the site. Press \/ for page actions. An AI assistant action sends the public page URL and a reading prompt to the selected service.

- [Design Records](/design/): implementation decisions, trade-offs, and proposals.
- [Release notes](/release/): changes and download files for each version.
- [Extension catalog](https://pigsty.io/ext/list/): extension descriptions and package information.
- [GitHub Issues](https://github.com/pgsty/pig/issues): report a problem or request a feature.

PIG is developed by [Vonng](https://vonng.com/en/) and released under [Apache 2.0](https://github.com/pgsty/pig/blob/v1.11.0/LICENSE). [Pigsty](https://pigsty.io/) provides PostgreSQL deployment, monitoring, backups, and high availability.
