This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

References

Detailed reference information and lists, supported Linux distros, available modules, metrics, extensions, and more.

1 - Supported Linux

Pigsty compatible Linux OS distribution major versions and CPU architectures

Pigsty runs on Linux, supporting amd64/x86_64 and arm64/aarch64 arch, plus 3 major distros: EL, Debian, Ubuntu.

Pigsty runs bare-metal without containers. Supports latest 2 major releases for each of the 3 major distros across both archs.

Overview

Recommended OS versions: RockyLinux 10.1, Ubuntu 24.04.4, Debian 13.3.

DistroArchOS CodePG18PG17PG16PG15PG14PG13
RHEL / Rocky / Alma 10x86_64el10.x86_64
RHEL / Rocky / Alma 10aarch64el10.aarch64
Ubuntu 24.04 (noble)x86_64u24.x86_64
Ubuntu 24.04 (noble)aarch64u24.aarch64
Debian 13 (trixie)x86_64d13.x86_64
Debian 13 (trixie)aarch64d13.aarch64

EL

Pigsty supports RHEL / Rocky / Alma / Anolis / CentOS 8, 9, 10.

EL DistroArchOS CodePG18PG17PG16PG15PG14PG13
RHEL10 / Rocky10 / Alma10x86_64el10.x86_64
RHEL10 / Rocky10 / Alma10aarch64el10.aarch64
RHEL9 / Rocky9 / Alma9x86_64el9.x86_64
RHEL9 / Rocky9 / Alma9aarch64el9.aarch64
RHEL8 / Rocky8 / Alma8x86_64el8.x86_64
RHEL8 / Rocky8 / Alma8aarch64el8.aarch64
RHEL7 / CentOS7x86_64el7.x86_64
RHEL7 / CentOS7aarch64-

Ubuntu

Pigsty supports Ubuntu 24.04 / 22.04:

Ubuntu DistroArchOS CodePG18PG17PG16PG15PG14PG13
Ubuntu 24.04 (noble)x86_64u24.x86_64
Ubuntu 24.04 (noble)aarch64u24.aarch64
Ubuntu 22.04 (jammy)x86_64u22.x86_64
Ubuntu 22.04 (jammy)aarch64u22.aarch64
Ubuntu 20.04 (focal)x86_64u20.x86_64
Ubuntu 20.04 (focal)aarch64-

Debian

Pigsty supports Debian 12 / 13, latest Debian 13.3 recommended:

Debian DistroArchOS CodePG18PG17PG16PG15PG14PG13
Debian 13 (trixie)x86_64d13.x86_64
Debian 13 (trixie)aarch64d13.aarch64
Debian 12 (bookworm)x86_64d12.x86_64
Debian 12 (bookworm)aarch64d12.aarch64
Debian 11 (bullseye)x86_64d11.x86_64
Debian 11 (bullseye)aarch64-

Vagrant

For local VM deployment, use these Vagrant base images (same as used in Pigsty dev):


Terraform

For cloud deployment, use these Terraform base images (Aliyun example):

  • Rocky 8.10 : rockylinux_8_10_x64_20G_alibase_20240923.vhd

  • Rocky 9.7 : rockylinux_9_7_x64_20G_alibase_20260119.vhd

  • Rocky 10.1 : rockylinux_10_1_x64_20G_alibase_20260119.vhd

  • Ubuntu 22.04.5 : ubuntu_22_04_x64_20G_alibase_20240926.vhd

  • Ubuntu 24.04.4 : ubuntu_24_04_x64_20G_alibase_20240923.vhd

  • Debian 12.13 : debian_12_13_x64_20G_alibase_20241201.vhd

  • Debian 13.3 : debian_13_3_x64_20G_alibase_20250101.vhd

  • Rocky 8.10 (aarch64) : rockylinux_8_10_arm64_20G_alibase_20251120.vhd

  • Rocky 9.7 (aarch64) : rockylinux_9_7_arm64_20G_alibase_20260119.vhd

  • Rocky 10.1 (aarch64) : rockylinux_10_1_arm64_20G_alibase_20260119.vhd

  • Ubuntu 22.04.5 (aarch64) : ubuntu_22_04_arm64_20G_alibase_20251126.vhd

  • Ubuntu 24.04.4 (aarch64) : ubuntu_24_04_arm64_20G_alibase_20251126.vhd

  • Debian 12.13 (aarch64) : debian_12_13_arm64_20G_alibase_20250825.vhd

  • Debian 13.3 (aarch64) : debian_13_3_arm64_20G_alibase_20251121.vhd

2 - Modules

This article lists available Pigsty modules and the current module planning.

Official Modules

ModuleCategoryStatusDocs PathSummary
PGSQLCoreGA/docs/pgsqlHigh-availability PostgreSQL clusters with built-in backup, monitoring, SOP, and extension ecosystem.
INFRACoreGA/docs/infraLocal software repository + VictoriaMetrics/Logs/Traces + Grafana infrastructure stack.
NODECoreGA/docs/nodeNode initialization and convergence: system tuning, admin, HAProxy, Vector, Docker, etc.
ETCDCoreGA/docs/etcdDCS for PostgreSQL HA (service discovery, config, leader-election metadata).
MINIOExtensionGA/docs/minioS3-compatible object storage, optionally used as PostgreSQL backup repository.
REDISExtensionGA/docs/redisRedis standalone/sentinel/cluster deployment and monitoring.
FERRETExtensionGA/docs/ferretFerretDB module (MONGO API compatibility) for MongoDB protocol access over PG.
DOCKERExtensionGA/docs/dockerDocker daemon and the runtime capability for containerized apps.
JUICEExtensionBETA/docs/juiceJuiceFS distributed file system using PostgreSQL as metadata engine.
VIBEExtensionBETA/docs/vibeBrowser-based dev environment with Code-Server, JupyterLab, Node.js, and Claude Code.

Core Modules

Pigsty provides four core modules that are important for delivering complete highly available PostgreSQL services:

  • PGSQL: Self-healing PostgreSQL clusters with HA, PITR, IaC, SOP, monitoring, and 451 extensions.
  • INFRA: Local software repository, Prometheus, Grafana, Loki, AlertManager, PushGateway, Blackbox Exporter…
  • NODE: Node convergence for hostname, timezone, NTP, ssh, sudo, haproxy, docker, vector, keepalived.
  • ETCD: Distributed key-value store used as DCS for HA PostgreSQL clusters: consensus leader election/config management/service discovery.

Although these four modules are usually installed together, separate use is still feasible. In practice, only the NODE module is usually mandatory.


Extension Modules

Pigsty provides six extension modules. They are not mandatory for core functionality, but can enhance PostgreSQL capabilities:

  • MINIO: S3-compatible object storage, optional PostgreSQL backup repository, with production deployment and monitoring support.
  • REDIS: Redis server with standalone/sentinel/cluster production deployment and full monitoring support.
  • MONGO: Native FerretDB deployment support, adding MongoDB wire-protocol compatible APIs to PostgreSQL.
  • DOCKER: Docker daemon service for one-click deployment of stateless software templates on Pigsty.
  • JUICE: JuiceFS distributed filesystem module using PostgreSQL as metadata engine, providing shared POSIX storage.
  • VIBE: Browser-based development environment with Code-Server, JupyterLab, Node.js, and Claude Code.

Ecosystem Modules

The modules below are closely related to the PostgreSQL ecosystem. They are optional ecosystem capabilities and are not counted in the 10 official modules above:

3 - Extensions

This page lists PostgreSQL extensions supported by Pigsty and their availability overview.

Pigsty extension data is synchronized from ~/pgsty/pgext/content/list/ext.md and ~/pgsty/pgext/db/extension.csv. For full details, see PGEXT.CLOUD.

There are currently 464 available PostgreSQL extensions.

TIME

ExtensionVersionCategoryDescription
timescaledb2.25.2TIMEEnables scalable inserts and complex queries for time-series data
timescaledb_toolkit1.22.0TIMELibrary of analytical hyperfunctions, time-series pipelining, and other SQL utilities
timeseries0.2.0TIMEConvenience API for time series stack
periods1.2.3TIMEProvide Standard SQL functionality for PERIODs and SYSTEM VERSIONING
temporal_tables1.2.2TIMEtemporal tables
emaj4.7.1TIMEEnables fine-grained write logging and time travel on subsets of the database.
table_version1.11.1TIMEPostgreSQL table versioning extension
pg_cron1.6.7TIMEJob scheduler for PostgreSQL
pg_task1.0.0TIMEexecute any sql command at any specific time at background
pg_later0.4.0TIMERun queries now and get results later
pg_background1.8TIMERun SQL queries in the background

GIS

ExtensionVersionCategoryDescription
postgis3.6.2GISPostGIS geometry and geography spatial types and functions
postgis_topology3.6.2GISPostGIS topology spatial types and functions
postgis_raster3.6.2GISPostGIS raster types and functions
postgis_sfcgal3.6.2GISPostGIS SFCGAL functions
postgis_tiger_geocoder3.6.2GISPostGIS tiger geocoder and reverse geocoder
address_standardizer3.6.2GISUsed to parse an address into constituent elements. Generally used to support geocoding address normalization step.
address_standardizer_data_us3.6.2GISAddress Standardizer US dataset example
pgrouting4.0.1GISpgRouting Extension
pointcloud1.2.5GISdata type for lidar point clouds
pointcloud_postgis1.2.5GISintegration for pointcloud LIDAR data and PostGIS geometry data
h34.2.3GISH3 bindings for PostgreSQL
h3_postgis4.2.3GISH3 PostGIS integration
q3c2.0.2GISq3c sky indexing plugin
ogr_fdw1.1.7GISforeign-data wrapper for GIS data access
geoip0.3.0GISIP-based geolocation query
pg_polyline0.0.1GISFast Google Encoded Polyline encoding & decoding for postgres
pg_eviltransform0.0.2GISBD09/GCJ02 coordinate transformation based on PostGIS ST_Transform
pg_geohash1.0GISHandle geohash based functionality for spatial coordinates
mobilitydb1.3.0GISMobilityDB geospatial trajectory data management & analysis platform
mobilitydb_datagen1.3.0GISMobilityDB random data generator functions
tzf0.2.3GISFast lookup timezone name by GPS coordinates
earthdistance1.2GIScalculate great-circle distances on the surface of the Earth

RAG

ExtensionVersionCategoryDescription
vector0.8.2RAGvector data type and ivfflat and hnsw access methods
vchord1.1.1RAGVector database plugin for Postgres, written in Rust
vectorscale0.9.0RAGAdvanced indexing for vector data with DiskANN
vectorize0.26.0RAGThe simplest way to do vector search on Postgres
pg_similarity1.0RAGsupport similarity queries
smlar1.0RAGEffective similarity search
pg_summarize0.0.1RAGText Summarization using LLMs. Built using pgrx
pg_tiktoken0.0.1RAGtiktoken tokenizer for use with OpenAI models in postgres
pg4ml2.0RAGMachine learning framework for PostgreSQL
pgml2.10.0RAGRun AL/ML workloads with SQL interface

FTS

ExtensionVersionCategoryDescription
pg_search0.21.12FTSFull text search for PostgreSQL using BM25
pgroonga4.0.4FTSUse Groonga as index, fast full text search platform for all languages!
pgroonga_database4.0.4FTSPGroonga database management module
pg_bigm1.2FTScreate 2-gram (bigram) index for faster full text search.
zhparser2.3FTSa parser for full-text search of Chinese
pg_bestmatch0.0.2FTSGenerate BM25 sparse vector inside PostgreSQL
vchord_bm250.3.0FTSA postgresql extension for bm25 ranking algorithm
pg_tokenizer0.1.1FTSTokenizers for full-text search
biscuit2.2.2FTSIAM-LIKE pattern matching with bitmap indexing
pg_textsearch0.5.0FTSFull-text search with BM25 ranking
pg_pinyin0.0.2FTSPostgreSQL Pinyin transliteration and search extension
hunspell_cs_cz1.0FTSCzech Hunspell Dictionary
hunspell_de_de1.0FTSGerman Hunspell Dictionary
hunspell_en_us1.0FTSen_US Hunspell Dictionary
hunspell_fr1.0FTSFrench Hunspell Dictionary
hunspell_ne_np1.0FTSNepali Hunspell Dictionary
hunspell_nl_nl1.0FTSDutch Hunspell Dictionary
hunspell_nn_no1.0FTSNorwegian (norsk) Hunspell Dictionary
hunspell_pt_pt1.0FTSPortuguese Hunspell Dictionary
hunspell_ru_ru1.0FTSRussian Hunspell Dictionary
hunspell_ru_ru_aot1.0FTSRussian Hunspell Dictionary (from AOT.ru group)
fuzzystrmatch1.2FTSdetermine similarities and distance between strings
pg_trgm1.6FTStext similarity measurement and index searching based on trigrams

OLAP

ExtensionVersionCategoryDescription
citus14.0.0OLAPDistributed PostgreSQL as an extension
citus_columnar14.0.0OLAPCitus columnar storage engine
columnar1.1.2OLAPHydra Columnar extension
pg_analytics0.3.7OLAPPostgres for analytics, powered by DuckDB
pg_duckdb1.1.1OLAPDuckDB Embedded in Postgres
pg_mooncake0.2.0OLAPColumnstore Table in Postgres
pg_clickhouse0.1.4OLAPInterfaces to query ClickHouse databases from PostgreSQL
duckdb_fdw1.1.2OLAPDuckDB Foreign Data Wrapper
pg_parquet0.5.1OLAPcopy data between Postgres and Parquet
pg_fkpart1.7.0OLAPTable partitioning by foreign key utility
pg_partman5.4.2OLAPExtension to manage partitioned tables by time or ID
plproxy2.11.0OLAPDatabase partitioning implemented as procedural language
pg_strom6.1OLAPPG-Strom - big-data processing acceleration using GPU and NVME
tablefunc1.0OLAPfunctions that manipulate whole tables, including crosstab

FEAT

ExtensionVersionCategoryDescription
age1.7.0FEATAGE graph database extension
hll2.19FEATtype for storing hyperloglog data
rum1.3.15FEATRUM index access method
pg_ai_query0.1.1FEATAI-powered SQL query generation for PostgreSQL
pg_ttl_index2.0.0FEATAutomatic data expiration with TTL indexes
pg_graphql1.5.12FEATAdd in-database GraphQL support
pg_jsonschema0.3.4FEATPostgreSQL extension providing JSON Schema validation
jsquery1.2FEATdata type for jsonb inspection
pg_hint_plan1.8.0FEATGive PostgreSQL ability to manually force some decisions in execution plans.
hypopg1.4.2FEATHypothetical indexes for PostgreSQL
index_advisor0.2.0FEATQuery index advisor
plan_filter0.0.1FEATfilter statements by their execution plans.
imgsmlr1.0FEATImage similarity with haar
pg_ivm1.13FEATincremental view maintenance on PostgreSQL
pg_incremental1.4.1FEATIncremental Processing by Crunchy Data
pgmb1.0.0FEATA simple PostgreSQL Message Broker system
pgmq1.11.0FEATA lightweight message queue. Like AWS SQS and RSMQ but on Postgres.
pgq3.5.1FEATGeneric queue for PostgreSQL
orioledb1.6FEATOrioleDB, the next generation transactional engine
pg_cardano1.1.1FEATA suite of Cardano-related tools
rdkit202503.1FEATCheminformatics functionality for PostgreSQL.
omni0.2.14FEATAdvanced adapter for Postgres extensions
omni_auth0.1.3FEATBasic session management
omni_aws0.1.2FEATAmazon Web Services APIs (S3)
omni_cloudevents0.1.0FEATCloudEvents support
omni_containers0.2.0FEATDocker container management
omni_credentials0.2.0FEATApplication credential management
omni_csv0.1.1FEATCSV toolkit
omni_datasets0.1.0FEATDataset provisioning
omni_email0.1.0FEATE-mail framework
omni_http0.1.0FEATBasic HTTP types
omni_httpc0.1.10FEATHTTP client
omni_httpd0.4.11FEATHTTP server
omni_id0.4.3FEATIdentity types
omni_json0.1.1FEATJSON toolkit
omni_kube0.4.2FEATKubernetes (k8s) integration
omni_ledger0.1.3FEATFinancial ledger
omni_manifest0.1.2FEATPackage installation manifests
omni_mimetypes0.1.0FEATMIME types
omni_os0.1.1FEATOperating system integration
omni_polyfill0.2.2FEATPostgres API polyfills
omni_python0.1.1FEATFirst-class Python support
omni_regex0.1.0FEATPCRE-compatible regular expressions
omni_rest0.1.1FEATREST API toolkit (with PostgREST support)
omni_schema0.3.0FEATAdvanced schema management tooling
omni_seq0.1.1FEATDistributed integer sequences
omni_service0.1.0FEATService management
omni_session0.2.0FEATSession management
omni_shmem0.1.0FEATShared Memory Management
omni_sql0.5.3FEATProgrammatic SQL manipulation
omni_sqlite0.2.2FEATEmbedded SQLite
omni_test0.4.0FEATTesting framework
omni_txn0.5.0FEATTransaction management
omni_types0.3.6FEATAdvanced types
omni_var0.3.0FEATScoped variables
omni_vfs0.2.2FEATVirtual File System
omni_vfs_types_v10.1.0FEATVirtual File System types (v1)
omni_web0.3.0FEATCommon web stack primitives
omni_worker0.2.1FEATGeneralized worker pool
omni_xml0.1.2FEATXML toolkit
omni_yaml0.1.0FEATYAML toolkit
bloom1.0FEATbloom access method - signature file based index

LANG

ExtensionVersionCategoryDescription
pg_tle1.5.2LANGTrusted Language Extensions for PostgreSQL
plv83.2.4LANGPL/JavaScript (v8) trusted procedural language
pljs1.0.5LANGPL/JS trusted procedural language
pllua2.0.12LANGLua as a procedural language
hstore_pllua2.0.12LANGHstore transform for Lua
plluau2.0.12LANGLua as an untrusted procedural language
hstore_plluau2.0.12LANGHstore transform for untrusted Lua
plprql18.0.1LANGUse PRQL in PostgreSQL - Pipelined Relational Query Language
pldbgapi1.9LANGserver-side support for debugging PL/pgSQL functions
plpgsql_check2.8.11LANGextended check for plpgsql functions
plprofiler4.2.5LANGserver-side support for profiling PL/pgSQL functions
plsh1.20220917LANGPL/sh procedural language
pljava1.6.10LANGPL/Java procedural language
plr8.4.8LANGload R interpreter and execute R script from within a database
plxslt0.20140221LANGXSLT procedural language for PostgreSQL
pgtap1.3.4LANGUnit testing for PostgreSQL
faker0.5.3LANGWrapper for the Faker Python library
dbt20.61.7LANGOSDL-DBT-2 test kit
pltcl1.0LANGPL/Tcl procedural language
pltclu1.0LANGPL/TclU untrusted procedural language
plperl1.0LANGPL/Perl procedural language
bool_plperl1.0LANGtransform between bool and plperl
hstore_plperl1.0LANGtransform between hstore and plperl
jsonb_plperl1.0LANGtransform between jsonb and plperl
plperlu1.0LANGPL/PerlU untrusted procedural language
bool_plperlu1.0LANGtransform between bool and plperlu
jsonb_plperlu1.0LANGtransform between jsonb and plperlu
hstore_plperlu1.0LANGtransform between hstore and plperlu
plpgsql1.0LANGPL/pgSQL procedural language
plpython3u1.0LANGPL/Python3U untrusted procedural language
jsonb_plpython3u1.0LANGtransform between jsonb and plpython3u
ltree_plpython3u1.0LANGtransform between ltree and plpython3u
hstore_plpython3u1.0LANGtransform between hstore and plpython3u

TYPE

ExtensionVersionCategoryDescription
prefix1.2.10TYPEPrefix Range module for PostgreSQL
semver0.41.0TYPESemantic version data type
unit7.10TYPESI units extension
pgpdf0.1.0TYPEPDF type with meta admin & Full-Text Search
pglite_fusion0.0.6TYPEEmbed an SQLite database in your PostgreSQL table
md5hash1.0.1TYPEtype for storing 128-bit binary data inline
asn1oid1.6TYPEasn1oid extension
roaringbitmap1.1.0TYPEsupport for Roaring Bitmaps
pgfaceting0.2.0TYPEfast faceting queries using an inverted index
pg_sphere1.5.2TYPEspherical objects with useful functions, operators and index support
country0.0.3TYPECountry data type, ISO 3166-1
pg_xenophile0.8.3TYPEMore than the bare necessities for PostgreSQL i18n and l10n.
l10n_table_dependent_extension0.8.3TYPEPostgreSQL l10n toolbox
currency0.0.3TYPECustom PostgreSQL currency type in 1Byte
collection1.1.1TYPEMemory optimized data type to be used inside of plpglsql func
pgmp1.0.5TYPEMultiple Precision Arithmetic extension
numeral1.3TYPEnumeral datatypes extension
pg_rational0.0.2TYPEbigint fractions
uint1.20250815TYPEunsigned integer types
uint1281.2.0TYPENative uint128 type
hashtypes0.1.5TYPEsha1, md5 and other data types for PostgreSQL
ip4r2.4.2TYPEIPv4/v6 and IPv4/v6 range index type for PostgreSQL
pg_duration1.0.2TYPEdata type for representing durations
uri1.20251029TYPEURI Data type for PostgreSQL
emailaddr0TYPEEmail address type for PostgreSQL
acl1.0.4TYPEACL Data type
debversion1.2.0TYPEDebian version number data type
pg_rrule0.3.0TYPERRULE field type for PostgreSQL
timestamp91.4.0TYPEtimestamp nanosecond resolution
chkpass1.0TYPEdata type for auto-encrypted passwords
isn1.2TYPEdata types for international product numbering standards
seg1.4TYPEdata type for representing line segments or floating-point intervals
cube1.5TYPEdata type for multidimensional cubes
ltree1.3TYPEdata type for hierarchical tree-like structures
hstore1.8TYPEdata type for storing sets of (key, value) pairs
citext1.6TYPEdata type for case-insensitive character strings
xml21.1TYPEXPath querying and XSLT

UTIL

ExtensionVersionCategoryDescription
gzip1.0.0UTILgzip and gunzip functions.
bzip1.0.0UTILBzip compression and decompression
zstd1.1.2UTILZstandard compression algorithm implementation in PostgreSQL
http1.7.0UTILHTTP client for PostgreSQL, allows web page retrieval inside the database.
pg_net0.20.2UTILAsync HTTP Requests
pg_curl2.4.5UTILRun curl actions for data transfer in URL syntax
pg_retry1.0.0UTILRetry SQL statements on transient errors with exponential backoff
pgjq0.1.0UTILUse jq in Postgres
pgjwt0.2.0UTILJSON Web Token API for Postgresql
pg_smtp_client0.2.1UTILPostgreSQL extension to send email using SMTP
pg_html5_email_address1.2.3UTILPostgreSQL email validation that is consistent with the HTML5 spec
url_encode1.2.5UTILurl_encode, url_decode functions
pgsql_tweaks1.0.2UTILSome functions and views for daily usage
pg_extra_time2.0.0UTILSome date time functions and operators that,
pgpcre0.20190509UTILPerl Compatible Regular Expression functions
icu_ext1.10.0UTILAccess ICU functions
pgqr1.0UTILQR Code generator from PostgreSQL
pg_protobuf1.0UTILProtobuf support for PostgreSQL
envvar1.0.1UTILFetch the value of an environment variable
floatfile1.3.1UTILSimple file storage for arrays of floats
pg_render0.1.3UTILRender HTML in SQL
pg_readme0.7.0UTILGenerate a README.md document for a database extension or schema
pg_readme_test_extension0.7.0UTILTest generating a README.md document for extension or schema
ddl_historization0.0.7UTILHistorize the ddl changes inside PostgreSQL database
data_historization1.1.0UTILPLPGSQL Script to historize data in partitionned table
schedoc0.0.1UTILCross documentation between Django and DBT projects
hashlib1.1UTILStable hash functions for Postgres
xxhash0.0.1UTILxxhash functions for PostgreSQL
shacrypt1.1UTILImplements SHA256-CRYPT and SHA512-CRYPT password encryption schemes
cryptint1.0.0UTILEncryption functions for int and bigint values
pguecc1.0UTILuECC bindings for Postgres
sparql1.0UTILQuery SPARQL datasource with SQL

FUNC

ExtensionVersionCategoryDescription
pg_idkit0.4.0FUNCmulti-tool for generating new/niche universally unique identifiers (ex. UUIDv6, ULID, KSUID)
pgx_ulid0.2.2FUNCulid type and methods
pg_uuidv71.7.0FUNCCreate UUIDv7 values in postgres
permuteseq1.2.2FUNCPseudo-randomly permute sequences with a format-preserving encryption on elements
pg_hashids1.3FUNCShort unique id generator for PostgreSQL, using hashids
sequential_uuids1.0.3FUNCgenerator of sequential UUIDs
typeid0.3.0FUNCAllows to use TypeIDs in Postgres natively
snowflake2.4FUNCSnowflake-style 64-bit ID generation and sequence utilities
topn2.7.0FUNCtype for top-n JSONB
quantile1.1.8FUNCQuantile aggregation function
lower_quantile1.0.3FUNCLower quantile aggregate function
count_distinct3.0.2FUNCAn alternative to COUNT(DISTINCT …) aggregate, usable with HashAggregate
omnisketch1.0.2FUNCdata structure for on-line agg of data into approximate sketch
ddsketch1.0.1FUNCProvides ddsketch aggregate function
vasco0.1.0FUNCdiscover hidden correlations in your data with MIC
xicor0.1.0FUNCXI Correlation Coefficient in Postgres
weighted_statistics1.0.0FUNCHigh-performance weighted statistics functions for sparse data
tdigest1.4.3FUNCProvides tdigest aggregate function.
first_last_agg0.1.4FUNCfirst() and last() aggregate functions
extra_window_functions1.0FUNCExtra Window Functions for PostgreSQL
floatvec1.1.1FUNCMath for vectors (arrays) of numbers
aggs_for_vecs1.4.1FUNCAggregate functions for array inputs
aggs_for_arrays1.3.3FUNCVarious functions for computing statistics on arrays of numbers
pg_csv1.0.1FUNCFlexible CSV processing for Postgres
arraymath1.1FUNCArray math and operators that work element by element on the contents of arrays
pg_math1.1.0FUNCGSL statistical functions for postgresql
random2.0.0FUNCrandom data generator
base361.0.0FUNCInteger Base36 types
base620.0.1FUNCBase62 extension for PostgreSQL
pg_base580.0.1FUNCBase58 Encoder/Decoder Extension for PostgreSQL
financial1.0.1FUNCFinancial aggregate functions
convert0.1.0FUNCconversion functions for spatial, routing and other specialized uses
refint1.0FUNCfunctions for implementing referential integrity (obsolete)
autoinc1.0FUNCfunctions for autoincrementing fields
insert_username1.0FUNCfunctions for tracking who changed a table
moddatetime1.0FUNCfunctions for tracking last modification time
tsm_system_time1.0FUNCTABLESAMPLE method which accepts time in milliseconds as a limit
dict_xsyn1.0FUNCtext search dictionary template for extended synonym processing
tsm_system_rows1.0FUNCTABLESAMPLE method which accepts number of rows as a limit
tcn1.0FUNCTriggered change notifications
uuid-ossp1.1FUNCgenerate universally unique identifiers (UUIDs)
btree_gist1.7FUNCsupport for indexing common datatypes in GiST
btree_gin1.3FUNCsupport for indexing common datatypes in GIN
intarray1.5FUNCfunctions, operators, and index support for 1-D arrays of integers
intagg1.1FUNCinteger aggregator and enumerator (obsolete)
dict_int1.0FUNCtext search dictionary template for integers
unaccent1.1FUNCtext search dictionary that removes accents

ADMIN

ExtensionVersionCategoryDescription
pg_repack1.5.3ADMINReorganize tables in PostgreSQL databases with minimal locks
pg_rewrite2.1.0ADMINTool allows read write to the table during the rewriting
pg_squeeze1.9.1ADMINA tool to remove unused space from a relation.
pg_dirtyread2.7ADMINRead dead but unvacuumed rows from table
pgfincore1.3.1ADMINexamine and manage the os buffer cache
pg_cooldown0.1ADMINremove buffered pages for specific relations
ddlx0.30ADMINDDL eXtractor functions
pglinter1.1.1ADMINPostgreSQL Linting and Analysis Extension
prioritize1.0.4ADMINget and set the priority of PostgreSQL backends
pg_checksums1.3ADMINActivate/deactivate/verify checksums in offline Postgres clusters
pg_readonly1.0.4ADMINcluster database read only
pgdd0.6.1ADMINIntrospect pg data dictionary via standard SQL
pg_permissions1.4ADMINview object permissions and compare them with the desired state
pgautofailover2.2ADMINpg_auto_failover
pg_catcheck1.6.0ADMINDiagnosing system catalog corruption
pre_prepare0.9ADMINPre Prepare your Statement server side
pg_upless0.0.3ADMINDetect Useless UPDATE
pgcozy1.0ADMINPre-warming shared buffers according to previous pg_buffercache snapshots for PostgreSQL.
pg_orphaned1.0ADMINDeal with orphaned files
pg_crash1.0ADMINSend random signals to random processes
pg_cheat_funcs1.0ADMINProvides cheat (but useful) functions
fio1.0ADMINPostgreSQL File I/O Functions
qos1.0ADMINPostgreSQL QoS resource governance extension (session & query throttling/isolation)
pg_savior0.0.1ADMINPostgres extension to save OOPS mistakes
safeupdate1.5ADMINRequire criteria for UPDATE and DELETE
pg_strict1.0.2ADMINPrevent dangerous UPDATE and DELETE without WHERE clause
pg_drop_events0.1.0ADMINlogs transaction ids of drop table, drop column, drop materialized view statements
table_log0.6.4ADMINrecord table modification logs and PITR for table/row
pgagent4.2.3ADMINA PostgreSQL job scheduler
pg_prewarm1.2ADMINprewarm relation data
pgpool_adm4.7.1ADMINAdministrative functions for pgPool
pgpool_recovery4.7.1ADMINrecovery functions for pgpool-II for V4.3
pgpool_regclass4.7.1ADMINreplacement for regclass
lo1.1ADMINLarge Object maintenance
basic_archive-ADMINan example of an archive module
basebackup_to_shell-ADMINadds a custom basebackup target called shell
old_snapshot1.0ADMINutilities in support of old_snapshot_threshold
adminpack2.1ADMINadministrative functions for PostgreSQL
amcheck1.4ADMINfunctions for verifying relation integrity
pg_surgery1.0ADMINextension to perform surgery on a damaged relation

STAT

ExtensionVersionCategoryDescription
pg_profile4.11STATPostgreSQL load profile repository and report builder
pg_tracing0.1.3STATDistributed Tracing for PostgreSQL
pg_show_plans2.1.7STATshow query plans of all currently running SQL statements
pg_stat_kcache2.3.1STATKernel statistics gathering
pg_stat_monitor2.3.2STATThe pg_stat_monitor is a PostgreSQL Query Performance Monitoring tool, based on PostgreSQL contrib module pg_stat_statements. pg_stat_monitor provides aggregated statistics, client information, plan details including plan, and histogram information.
pg_qualstats2.1.3STATAn extension collecting statistics about quals
pg_store_plans1.9STATtrack plan statistics of all SQL statements executed
pg_track_settings2.1.2STATTrack settings changes
pg_track_optimizer0.9.1STATTrack planning decisions in comparison with execution reality
pg_wait_sampling1.1.9STATsampling based statistics of wait events
pgsentinel1.4.0STATactive session history
system_stats3.2STATEnterpriseDB system statistics for PostgreSQL
meta0.4.0STATNormalized, friendlier system catalog for PostgreSQL
pgnodemx1.7STATCapture node OS metrics via SQL queries
pg_proctab1.7STATPostgreSQL extension to access the OS process table
pg_sqlog1.6STATProvide SQL interface to logs
bgw_replstatus1.0.8STATSmall PostgreSQL background worker to report whether a node is a replication master or standby
pgmeminfo1.0.0STATshow memory usage
toastinfo1.5STATshow details on toasted datums
explain_ui0.0.2STATeasily jump into a visual plan UI for any SQL query
pg_relusage0.0.1STATLog all the queries that reference a particular column
pagevis0.1STATVisualise database pages in ascii code
powa5.1.1STATPostgreSQL Workload Analyser-core
pg_overexplain1.0STATAllow EXPLAIN to dump even more details
pg_logicalinspect1.0STATLogical decoding components inspection
pageinspect1.12STATinspect the contents of database pages at a low level
pgrowlocks1.2STATshow row-level locking information
sslinfo1.2STATinformation about SSL certificates
pg_buffercache1.5STATexamine the shared buffer cache
pg_walinspect1.1STATfunctions to inspect contents of PostgreSQL Write-Ahead Log
pg_freespacemap1.2STATexamine the free space map (FSM)
pg_visibility1.2STATexamine the visibility map (VM) and page-level visibility info
pgstattuple1.5STATshow tuple-level statistics
auto_explain-STATProvides a means for logging execution plans of slow statements automatically
pg_stat_statements1.11STATtrack planning and execution statistics of all SQL statements executed

SEC

ExtensionVersionCategoryDescription
passwordcheck_cracklib3.1.0SECStrengthen PostgreSQL user password checks with cracklib
supautils3.1.0SECExtension that secures a cluster on a cloud environment
pgsodium3.1.9SECPostgres extension for libsodium functions
supabase_vault0.3.1SECSupabase Vault Extension
pg_session_jwt0.4.0SECManage authentication sessions using JWTs
anon3.0.1SECPostgreSQL Anonymizer (anon) extension
pgsmcrypto0.1.1SECPostgreSQL SM Algorithm Extension
pg_enigma0.5.0SECEncrypted postgres data type
pgaudit18.0SECprovides auditing functionality
pgauditlogtofile1.8.0SECpgAudit addon to redirect audit log to an independent file
pg_auditor0.2SECAudit data changes and provide flashback ability
logerrors2.1.5SECFunction for collecting statistics about messages in logfile
pg_auth_mon3.0SECmonitor connection attempts per user
pg_jobmon1.4.1SECExtension for logging and monitoring functions in PostgreSQL
credcheck4.6SECcredcheck - postgresql plain text credential checker
pgcryptokey0.85SECcryptographic key management
pg_pwhash1.0SECAdvanced password hashing methods for PostgreSQL
login_hook1.7SEClogin_hook - hook to execute login_hook.login() at login time
set_user4.2.0SECsimilar to SET ROLE but with added logging
pg_snakeoil1.4SECThe PostgreSQL Antivirus
pgextwlist1.19SECPostgreSQL Extension Whitelisting
sslutils1.4SECA Postgres extension for managing SSL certificates through SQL
noset0.3.0SECModule for blocking SET variables for non-super users.
pg_tde2.1SECPercona pg_tde access method
sepgsql-SEClabel-based mandatory access control (MAC) based on SELinux security policy.
auth_delay-SECpause briefly before reporting authentication failure
pgcrypto1.3SECcryptographic functions
passwordcheck-SECchecks user passwords and reject weak password

FDW

ExtensionVersionCategoryDescription
wrappers0.5.7FDWForeign data wrappers developed by Supabase
multicorn3.2FDWFetch foreign data in Python in your PostgreSQL server.
odbc_fdw0.5.1FDWForeign data wrapper for accessing remote databases using ODBC
jdbc_fdw0.4.0FDWforeign-data wrapper for remote servers available over JDBC
pgspider_ext1.3.0FDWforeign-data wrapper for remote PGSpider servers
mysql_fdw2.9.3FDWForeign data wrapper for querying a MySQL server
oracle_fdw2.8.0FDWforeign data wrapper for Oracle access
tds_fdw2.0.5FDWForeign data wrapper for querying a TDS database (Sybase or Microsoft SQL Server)
db2_fdw18.1.1FDWforeign data wrapper for DB2 access
sqlite_fdw2.5.0FDWSQLite Foreign Data Wrapper
pgbouncer_fdw1.4.0FDWExtension for querying PgBouncer stats from normal SQL views & running pgbouncer commands from normal SQL functions
etcd_fdw0.0.0FDWForeign data wrapper for etcd
informix_fdw0.6.3FDWForeign data wrapper for Informix access
nominatim_fdw1.1.0FDWNominatim Foreign Data Wrapper for PostgreSQL
mongo_fdw5.5.3FDWforeign data wrapper for MongoDB access
redis_fdw1.0FDWForeign data wrapper for querying a Redis server
redis0.0.1FDWSend redis pub/sub messages to Redis from PostgreSQL Directly
kafka_fdw0.0.3FDWkafka Foreign Data Wrapper for CSV formatted messages
hdfs_fdw2.3.3FDWforeign-data wrapper for remote hdfs servers
firebird_fdw1.4.1FDWForeign data wrapper for Firebird
aws_s30.0.1FDWaws_s3 postgres extension to import/export data from/to s3
log_fdw1.4FDWforeign-data wrapper for Postgres log file access
dblink1.2FDWconnect to other PostgreSQL databases from within a database
file_fdw1.0FDWforeign-data wrapper for flat file access
postgres_fdw1.1FDWforeign-data wrapper for remote PostgreSQL servers

SIM

ExtensionVersionCategoryDescription
documentdb0.109SIMAPI surface for DocumentDB for PostgreSQL
documentdb_core0.109SIMCore API surface for DocumentDB for PostgreSQL
documentdb_distributed0.109SIMMulti-Node API surface for DocumentDB
documentdb_extended_rum0.109SIMDocumentDB Extended RUM index access method
orafce4.16.4SIMFunctions and operators that emulate a subset of functions and packages from the Oracle RDBMS
pgtt4.4SIMExtension to add Global Temporary Tables feature to PostgreSQL
session_variable3.4SIMRegistration and manipulation of session variables and constants
pg_statement_rollback1.5SIMServer side rollback at statement level for PostgreSQL like Oracle or DB2
ivorysql_ora1.0SIMOracle compatibility extension
ora_btree_gin1.0SIMGIN index support for Oracle data types
ora_btree_gist1.0SIMGiST index support for Oracle data types
pg_get_functiondef1.0SIMGet function definition
plisql1.0SIMPL/iSQL procedural language
gb18030_20221.0SIMSupport GB18030-2022 to UTF-8 encoding conversion
pg_dbms_metadata1.0.0SIMExtension to add Oracle DBMS_METADATA compatibility to PostgreSQL
pg_dbms_lock1.0SIMExtension to add Oracle DBMS_LOCK full compatibility to PostgreSQL
pg_dbms_job1.5SIMExtension to add Oracle DBMS_JOB full compatibility to PostgreSQL
pg_dbms_errlog2.2SIMEmulate DBMS_ERRLOG Oracle module to log DML errors in a dedicated table.
pg_utl_smtp1.0.0SIMOracle UTL_SMTP compatibility extension for PostgreSQL
babelfishpg_common5.5.0SIMSQL Server Transact SQL Datatype Support
babelfishpg_tsql5.5.0SIMSQL Server Transact SQL compatibility
babelfishpg_tds1.0.0SIMSQL Server TDS protocol extension
babelfishpg_money1.1.0SIMSQL Server Money Data Type
spat0.1.0a4SIMRedis-like In-Memory DB Embedded in Postgres
pgmemcache2.3.0SIMmemcached interface
aux_mysql1.5SIMMySQL compatibility auxiliary extension module

ETL

ExtensionVersionCategoryDescription
pglogical2.4.6ETLPostgreSQL Logical Replication
pglogical_origin2.4.6ETLDummy extension for compatibility when upgrading from Postgres 9.4
pglogical_ticker1.4.1ETLHave an accurate view on pglogical replication delay
pgl_ddl_deploy2.2.1ETLautomated ddl deployment using pglogical
pg_failover_slots1.2.0ETLPG Failover Slots extension
db_migrator1.0.0ETLTools to migrate other databases to PostgreSQL
pgactive2.1.7ETLActive-Active Replication Extension for PostgreSQL
spock5.0.5ETLMulti-master logical replication extension for PostgreSQL
lolor1.2.2ETLExtension to make PostgreSQL large objects compatible with logical replication
wal2json2.6ETLChanging data capture in JSON format
wal2mongo1.0.7ETLPostgreSQL logical decoding output plugin for MongoDB
decoderbufs3.4.1ETLLogical decoding plugin that delivers WAL stream changes using a Protocol Buffer format
decoder_raw1.0ETLOutput plugin for logical replication in Raw SQL format
mimeo1.5.1ETLExtension for specialized, per-table replication between PostgreSQL instances
repmgr5.5.0ETLReplication manager for PostgreSQL
pg_fact_loader2.0.1ETLbuild fact tables with Postgres
pg_bulkload3.1.23ETLpg_bulkload is a high speed data loading utility for PostgreSQL
test_decoding-ETLSQL-based test/example module for WAL logical decoding
pgoutput-ETLLogical Replication output plugin

4 - File Hierarchy

How Pigsty’s file system structure is designed and organized, and directory structures used by each module.

Pigsty FHS

Pigsty’s home directory is located at ~/pigsty by default. The file structure within this directory is as follows:

#------------------------------------------------------------------------------
# pigsty
#  ^-----@app                    # Extra application resources and examples
#  ^-----@bin                    # Utility scripts
#  ^-----@docs                   # Documentation (docsify-compatible)
#  ^-----@files                  # Ansible file resources
#            ^-----@victoria     # Victoria rules and ops scripts (bin/rules)
#            ^-----@grafana      # Grafana dashboards
#            ^-----@postgres     # /pg/bin/ scripts
#            ^-----@migration    # PGSQL migration task definitions
#            ^-----@pki          # Self-signed CA and certificates
#  ^-----@roles                  # Ansible role implementations
#  ^-----@templates              # Ansible template files
#  ^-----@vagrant                # Vagrant sandbox VM templates
#  ^-----@terraform              # Terraform cloud VM provisioning templates
#  ^-----configure               # Configuration wizard script
#  ^-----ansible.cfg             # Ansible default configuration
#  ^-----pigsty.yml              # Pigsty default configuration file
#  ^-----*.yml                   # Ansible playbooks
#------------------------------------------------------------------------------
# /infra -> /data/infra          # infra runtime symlink
# /data/infra                    # root:infra 0771
#  ^-----@metrics                # VictoriaMetrics TSDB data
#  ^-----@logs                   # VictoriaLogs data
#  ^-----@traces                 # VictoriaTraces data
#  ^-----@alertmgr               # AlertManager data
#  ^-----@rules                  # rule definitions (including agent.yml)
#  ^-----@targets                # FileSD monitoring targets
#  ^-----@dashboards             # Grafana dashboard definitions
#  ^-----@datasources            # Grafana datasource definitions
#  ^-----prometheus.yml          # Victoria Prometheus-compatible config
#------------------------------------------------------------------------------

CA FHS

Pigsty’s self-signed CA is located in files/pki/ under the Pigsty home directory.

You must keep the CA key file secure: files/pki/ca/ca.key. This key is generated by the ca role during deploy.yml or infra.yml execution.

# pigsty/files/pki                           # (local_user) 0755
#  ^-----@ca                                 # (local_user) 0700
#         ^[email protected]                      # 0600, CRITICAL: keep secret
#         ^[email protected]                      # 0644, CRITICAL: trust anchor
#  ^-----@csr                                # (local_user) 0755, CSRs
#  ^-----@misc                               # (local_user) 0755, misc/issued certs
#  ^-----@etcd                               # (local_user) 0755, ETCD certs
#  ^-----@minio                              # (local_user) 0755, MinIO certs
#  ^-----@nginx                              # (local_user) 0755, Nginx SSL certs
#  ^-----@infra                              # (local_user) 0755, infra client certs
#  ^-----@pgsql                              # (local_user) 0755, PostgreSQL certs
#  ^-----@mongo                              # (local_user) 0755, Mongo/FerretDB certs
#  ^-----@mysql                              # (local_user) 0755, MySQL certs (placeholder)

Nodes managed by Pigsty will have the following certificate files installed:

/etc/pki/ca.crt                             # root:root 0644, root cert on all nodes
/etc/pki/ca-trust/source/anchors/ca.crt     # Symlink to system trust anchors

All infra nodes will have the following certificates:

/etc/pki/infra.crt                          # root:infra 0644, infra node cert
/etc/pki/infra.key                          # root:infra 0640, infra node key

When your admin node fails, the files/pki directory and pigsty.yml file should be available on the backup admin node. You can use rsync to achieve this:

# run on meta-1, rsync to meta2
cd ~/pigsty;
rsync -avz ./ meta-2:~/pigsty

INFRA FHS

The infra role creates infra_data (default: /data/infra) and creates a symlink /infra -> /data/infra. /data/infra permissions are root:infra 0771; subdirectories default to *:infra 0750 unless overridden:

# /infra -> /data/infra
# /data/infra                              # root:infra 0771
#  ^-----@pgadmin                          # 5050:5050 0700
#  ^-----@alertmgr                         # prometheus:infra 0700
#  ^-----@conf                             # root:infra 0750
#            ^-----patronictl.yml          # root:admin 0640
#  ^-----@tmp                              # root:infra 0750
#  ^-----@hosts                            # dnsmasq:dnsmasq 0755 (DNS records)
#            ^-----default                 # root:root 0644
#  ^-----@datasources                      # root:infra 0750
#            ^-----*.json                  # 0600 (generated by register)
#  ^-----@dashboards                       # grafana:infra 0750
#  ^-----@metrics                          # victoria:infra 0750
#  ^-----@logs                             # victoria:infra 0750
#  ^-----@traces                           # victoria:infra 0750
#  ^-----@bin                              # victoria:infra 0750
#            ^-----check|new|reload|status # root:infra 0755
#  ^-----@rules                            # victoria:infra 0750
#            ^-----agent.yml               # victoria:infra 0644
#            ^-----infra.yml               # victoria:infra 0644
#            ^-----node.yml                # victoria:infra 0644
#            ^-----pgsql.yml               # victoria:infra 0644
#            ^-----redis.yml               # victoria:infra 0644
#            ^-----etcd.yml                # victoria:infra 0644
#            ^-----minio.yml               # victoria:infra 0644
#            ^-----kafka.yml               # victoria:infra 0644
#            ^-----mysql.yml               # victoria:infra 0644
#  ^-----@targets                          # victoria:infra 0750
#            ^-----@infra                  # infra targets (files 0640)
#            ^-----@node                   # node targets (files 0640)
#            ^-----@ping                   # ping targets (files 0640)
#            ^-----@etcd                   # etcd targets (files 0640)
#            ^-----@pgsql                  # pgsql targets (files 0640)
#            ^-----@pgrds                  # pgrds targets (files 0640)
#            ^-----@redis                  # redis targets (files 0640)
#            ^-----@minio                  # minio targets (files 0640)
#            ^-----@mongo                  # mongo targets (files 0640)
#            ^-----@juice                  # juicefs targets (files 0640)
#            ^-----@mysql                  # mysql targets (files 0640)
#            ^-----@kafka                  # kafka targets (files 0640)
#            ^-----@docker                 # docker targets (files 0640)
#            ^-----@patroni                # patroni SSL targets (files 0640)
#  ^-----prometheus.yml                    # victoria:infra 0644

This structure is created by: roles/infra/tasks/dir.yml, roles/infra/tasks/victoria.yml, roles/infra/tasks/register.yml, roles/infra/tasks/dns.yml, and roles/infra/tasks/env.yml.


NODE FHS

The node data directory is specified by node_data, defaulting to /data, owned by root:root with mode 0755.

Each component’s default data directory is located under this data directory:

/data                                 # root:root 0755
#  ^-----@postgres                    # postgres:postgres 0700 (default pg_fs_main)
#  ^-----@backups                     # postgres:postgres 0700 (default pg_fs_backup)
#  ^-----@redis                       # redis:redis 0700 (shared by multiple instances)
#  ^-----@minio                       # minio:minio 0750 (single-node single-disk mode)
#  ^-----@etcd                        # etcd:etcd 0700 (etcd_data)
#  ^-----@infra                       # root:infra 0771 (infra module data directory)
#  ^-----@docker                      # root:root 0755 (Docker data directory)
#  ^-----@...                         # Other component data directories

Victoria FHS

Monitoring config has moved from the legacy /etc/prometheus layout to the /infra runtime layout. The main template is roles/infra/templates/victoria/prometheus.yml, rendered to /infra/prometheus.yml.

files/victoria/bin/* and files/victoria/rules/* are synced to /infra/bin/ and /infra/rules/, while each module registers FileSD targets under /infra/targets/*.

# /infra
#  ^-----prometheus.yml              # Victoria main config (Prometheus-compatible) 0644
#  ^-----@bin                        # Utility scripts (check/new/reload/status) 0755
#  ^-----@rules                      # Recording and alerting rules (*.yml 0644)
#            ^-----agent.yml         # Agent pre-aggregation rules
#            ^-----infra.yml         # infra rules and alerts
#            ^-----etcd.yml          # etcd rules and alerts
#            ^-----node.yml          # node rules and alerts
#            ^-----pgsql.yml         # pgsql rules and alerts
#            ^-----redis.yml         # redis rules and alerts
#            ^-----minio.yml         # minio rules and alerts
#            ^-----kafka.yml         # kafka rules and alerts
#            ^-----mysql.yml         # mysql rules and alerts
#  ^-----@targets                    # FileSD targets (*.yml 0640)
#            ^-----@infra            # infra static targets
#            ^-----@node             # node static targets
#            ^-----@pgsql            # pgsql static targets
#            ^-----@pgrds            # pgsql remote RDS targets
#            ^-----@redis            # redis static targets
#            ^-----@minio            # minio static targets
#            ^-----@mongo            # mongo static targets
#            ^-----@mysql            # mysql static targets
#            ^-----@etcd             # etcd static targets
#            ^-----@ping             # ping static targets
#            ^-----@kafka            # kafka static targets
#            ^-----@juice            # juicefs static targets
#            ^-----@docker           # docker static targets
#            ^-----@patroni          # patroni static targets (when SSL enabled)
# /etc/default/vmetrics              # vmetrics startup args (victoria:infra 0644)
# /etc/default/vlogs                 # vlogs startup args (victoria:infra 0644)
# /etc/default/vtraces               # vtraces startup args (victoria:infra 0644)
# /etc/default/vmalert               # vmalert startup args (victoria:infra 0644)
# /etc/alertmanager.yml              # alertmanager main config (prometheus:infra 0644)
# /etc/default/alertmanager          # alertmanager env (prometheus:infra 0640)
# /etc/blackbox.yml                  # blackbox main config (prometheus:infra 0644)
# /etc/default/blackbox_exporter     # blackbox env (prometheus:infra 0644)

PostgreSQL FHS

The following parameters are related to PostgreSQL directory layout:

  • pg_dbsu_home: Postgres default user home directory, default: /var/lib/pgsql
  • pg_bin_dir: Postgres binary directory, default: /usr/pgsql/bin/
  • pg_data: Postgres data directory, default: /pg/data
  • pg_fs_main: Postgres primary data directory, default: /data/postgres
  • pg_fs_backup: Postgres backup disk mount point, default: /data/backups (optional; can also be a subdirectory on primary disk)
  • pg_cluster_dir: Derived variable, {{ pg_fs_main }}/{{ pg_cluster }}-{{ pg_version }}
  • pg_backup_dir: Derived variable, {{ pg_fs_backup }}/{{ pg_cluster }}-{{ pg_version }}
#--------------------------------------------------------------#
# Working assumptions:
#   {{ pg_fs_main   }} primary data directory, default: `/data/postgres` [SSD]
#   {{ pg_fs_backup }} backup data disk, default: `/data/backups`        [HDD]
#--------------------------------------------------------------#
# Default config (pg_cluster=pg-test, pg_version=18):
#     pg_fs_main = /data/postgres      High-speed SSD
#     pg_fs_backup = /data/backups     Cheap HDD (optional)
#
#     /pg        -> /data/postgres/pg-test-18
#     /pg/data   -> /data/postgres/pg-test-18/data
#     /pg/backup -> /data/backups/pg-test-18/backup
#--------------------------------------------------------------#
- name: create pgsql directories
  tags: pg_dir
  become: true
  block:

    - name: create pgsql directories
      file: path={{ item.path }} state=directory owner={{ item.owner|default(pg_dbsu) }} group={{ item.group|default('postgres') }} mode={{ item.mode }}
      with_items:
        - { path: "{{ pg_fs_main }}"            ,mode: "0700" }
        - { path: "{{ pg_fs_backup }}"          ,mode: "0700" }
        - { path: "{{ pg_cluster_dir }}"        ,mode: "0700" }
        - { path: "{{ pg_cluster_dir }}/bin"    ,mode: "0700" }
        - { path: "{{ pg_cluster_dir }}/log"    ,mode: "0750" }
        - { path: "{{ pg_cluster_dir }}/tmp"    ,mode: "0700" }
        - { path: "{{ pg_cluster_dir }}/cert"   ,mode: "0700" }
        - { path: "{{ pg_cluster_dir }}/conf"   ,mode: "0700" }
        - { path: "{{ pg_cluster_dir }}/data"   ,mode: "0700" }
        - { path: "{{ pg_cluster_dir }}/spool"  ,mode: "0700" }
        - { path: "{{ pg_backup_dir }}/backup"  ,mode: "0700" }
        - { path: "/var/run/postgresql"         ,owner: root, group: root, mode: "0755" }

    - name: link pgsql directories
      file: src={{ item.src }} dest={{ item.dest }} state=link
      with_items:
        - { src: "{{ pg_backup_dir }}/backup" ,dest: "{{ pg_cluster_dir }}/backup" }
        - { src: "{{ pg_cluster_dir }}"       ,dest: "/pg" }

Data File Structure

# Physical directories
{{ pg_fs_main }}     /data/postgres                    # postgres:postgres 0700, primary data directory
{{ pg_cluster_dir }} /data/postgres/pg-test-18         # postgres:postgres 0700, cluster directory
                     /data/postgres/pg-test-18/bin     # postgres:postgres 0700 (scripts root:postgres 0755)
                     /data/postgres/pg-test-18/log     # postgres:postgres 0750, logs
                     /data/postgres/pg-test-18/tmp     # postgres:postgres 0700, temp files
                     /data/postgres/pg-test-18/cert    # postgres:postgres 0700, certs
                     /data/postgres/pg-test-18/conf    # postgres:postgres 0700, config index
                     /data/postgres/pg-test-18/data    # postgres:postgres 0700, main data
                     /data/postgres/pg-test-18/spool   # postgres:postgres 0700, pgBackRest spool
                     /data/postgres/pg-test-18/backup  # -> /data/backups/pg-test-18/backup

{{ pg_fs_backup  }}  /data/backups                     # postgres:postgres 0700, optional backup mount
{{ pg_backup_dir }}  /data/backups/pg-test-18          # postgres:postgres 0700, cluster backup directory
                     /data/backups/pg-test-18/backup   # postgres:postgres 0700, actual backup location

# Symlinks
/pg             ->   /data/postgres/pg-test-18         # pg root symlink
/pg/data        ->   /data/postgres/pg-test-18/data    # pg data directory
/pg/backup      ->   /data/backups/pg-test-18/backup   # pg backup directory

Binary File Structure

On EL-compatible distributions (using yum), PostgreSQL default installation location is:

/usr/pgsql-${pg_version}/

Pigsty creates a symlink named /usr/pgsql pointing to the actual version specified by the pg_version parameter, for example:

/usr/pgsql -> /usr/pgsql-18

Therefore, the default pg_bin_dir is /usr/pgsql/bin/, and this path is added to the system PATH environment variable, defined in: /etc/profile.d/pgsql.sh.

export PATH="/usr/pgsql/bin:/pg/bin:$PATH"
export PGHOME=/usr/pgsql
export PGDATA=/pg/data

On Ubuntu/Debian, the default PostgreSQL Deb package installation location is:

/usr/lib/postgresql/${pg_version}/bin

Pgbouncer FHS

Pgbouncer runs under the same user as {{ pg_dbsu }} (default postgres), with configs in /etc/pgbouncer.

  • pgbouncer.ini: main pool configuration (postgres:postgres 0640)
  • database.txt: pooled database definitions (postgres:postgres 0600)
  • useropts.txt: per-user connection options (postgres:postgres 0600)
  • userlist.txt: password file maintained by /pg/bin/pgb-user
  • pgb_hba.conf: access control file (postgres:postgres 0600)
/etc/pgbouncer/                # postgres:postgres 0750
/etc/pgbouncer/pgbouncer.ini   # postgres:postgres 0640
/etc/pgbouncer/database.txt    # postgres:postgres 0600
/etc/pgbouncer/useropts.txt    # postgres:postgres 0600
/etc/pgbouncer/userlist.txt    # postgres:postgres (managed by pgb-user)
/etc/pgbouncer/pgb_hba.conf    # postgres:postgres 0600
/pg/log/pgbouncer              # postgres:postgres 0750
/var/run/postgresql            # {{ pg_dbsu }}:postgres 0755 (managed by tmpfiles)

Redis FHS

Pigsty provides basic support for Redis deployment and monitoring.

Redis binaries are usually installed by the system package manager (service paths use /bin/*, with /usr/bin/* compatibility symlinks on most distros):

redis-server
redis-cli
redis-sentinel
redis-check-rdb
redis-check-aof
redis-benchmark
/usr/libexec/redis-shutdown

For a Redis instance named redis-test-1-6379, the related resources are as follows:

/usr/lib/systemd/system/redis-test-1-6379.service     # root:root 0644 (Debian: /lib/systemd/system)
/etc/redis/                                           # redis:redis 0700
/etc/redis/redis-test-1-6379.conf                     # redis:redis 0700
/data/redis/                                          # redis:redis 0700
/data/redis/redis-test-1-6379                         # redis:redis 0700
/data/redis/redis-test-1-6379/redis-test-1-6379.rdb   # RDB file
/data/redis/redis-test-1-6379/redis-test-1-6379.aof   # AOF file
/var/log/redis/                                       # redis:redis 0700
/var/log/redis/redis-test-1-6379.log                  # logs
/var/run/redis/                                       # redis:redis 0700 (tmpfiles creates 0755 at boot)
/var/run/redis/redis-test-1-6379.pid                  # PID

For Ubuntu/Debian, the default systemd service directory is /lib/systemd/system/ instead of /usr/lib/systemd/system/.

5 - Parameters

Pigsty v4.x configuration overview and module parameter navigation

This is the parameter navigation page for Pigsty v4.x, without repeating full explanations for each parameter. For parameter details, please read each module’s param page.

According to current documentation scope, official modules contain about 360 parameters across 10 modules.


Module Parameter Navigation

ModuleGroupsCountDescription
PGSQL9125PostgreSQL HA cluster configuration
INFRA1072Software repository and Victoria-based observability infra
NODE1173Node initialization, system tuning, and ops baseline
ETCD213ETCD cluster and removal safeguard parameters
MINIO221MinIO deployment and removal parameters
REDIS221Redis deployment and removal parameters
FERRET19FerretDB (Mongo API) parameters
DOCKER18Docker engine parameters
JUICE12JuiceFS instance and cache parameters
VIBE116Code/Jupyter/Node.js/Claude configuration

Parameter Group Quick View

ModuleMajor Groups
PGSQLPG_ID, PG_BUSINESS, PG_INSTALL, PG_BOOTSTRAP, PG_PROVISION, PG_BACKUP, PG_ACCESS, PG_MONITOR, PG_REMOVE
INFRAMETA, CA, INFRA_ID, REPO, INFRA_PACKAGE, NGINX, DNS, VICTORIA, PROMETHEUS, GRAFANA
NODENODE_ID, NODE_DNS, NODE_PACKAGE, NODE_TUNE, NODE_SEC, NODE_ADMIN, NODE_TIME, NODE_VIP
HAPROXY, NODE_EXPORTER, VECTOR
ETCDETCD, ETCD_REMOVE
MINIOMINIO, MINIO_REMOVE
REDISREDIS, REDIS_REMOVE
FERRETFERRET
DOCKERDOCKER
JUICEJUICE
VIBEVIBE

Recommendations

  • Read in this order for first deployment: NODE, INFRA, PGSQL
  • In production, always review: *_safeguard, password credentials, ports, and network exposure
  • Validate changes on one cluster first, then roll out globally in batches

6 - Playbooks

Pigsty v4.x preset Ansible playbook navigation and execution notes

This page summarizes Pigsty v4.x playbook entries and usage guidance by module. For detailed task tags, open each module’s playbook page.

Module Playbook Navigation

ModuleCountPlaybooks
INFRA3deploy.yml infra.yml infra-rm.yml
NODE2node.yml node-rm.yml
ETCD2etcd.yml etcd-rm.yml
PGSQL7pgsql.yml pgsql-rm.yml
pgsql-user.yml pgsql-db.yml
pgsql-monitor.yml pgsql-migration.yml pgsql-pitr.yml
REDIS2redis.yml redis-rm.yml
MINIO2minio.yml minio-rm.yml
FERRET1mongo.yml
DOCKER1docker.yml
JUICE1juice.yml
VIBE1vibe.yml

Playbook Matrix

PlaybookModulePurpose
deploy.ymlINFRAOne-pass deployment for the core chain (Infra/Node/Etcd/PGSQL, enabling MinIO by config)
infra.ymlINFRAInitialize infrastructure nodes
infra-rm.ymlINFRARemove infrastructure components
node.ymlNODENode onboarding and baseline convergence
node-rm.ymlNODENode offboarding
etcd.ymlETCDETCD install/scale-out
etcd-rm.ymlETCDETCD remove/scale-in
pgsql.ymlPGSQLInitialize PostgreSQL cluster or add instance
pgsql-rm.ymlPGSQLRemove PostgreSQL cluster/instance
pgsql-user.ymlPGSQLAdd business users
pgsql-db.ymlPGSQLAdd business databases
pgsql-monitor.ymlPGSQLRegister remote PostgreSQL for monitoring
pgsql-migration.ymlPGSQLGenerate migration runbook and scripts
pgsql-pitr.ymlPGSQLPoint-in-time recovery (PITR)
redis.ymlREDISDeploy Redis
redis-rm.ymlREDISRemove Redis
minio.ymlMINIODeploy MinIO
minio-rm.ymlMINIORemove MinIO
mongo.ymlFERRETDeploy FerretDB (Mongo API)
docker.ymlDOCKERDeploy Docker engine
juice.ymlJUICEDeploy/remove JuiceFS instances
vibe.ymlVIBEDeploy VIBE dev environment

Auxiliary Playbooks

The following playbooks are cross-module helpers.

PlaybookDescription
cache.ymlBuild offline installation package cache
cert.ymlIssue certificates using Pigsty CA
app.ymlInstall Docker Compose app templates
slim.ymlMinimal component installation scenario

Playbook Usage Notes

Protection Mechanism

Several modules provide deletion safeguards through *_safeguard parameters:

By default, these safeguard parameters are undefined (not enabled). In production, explicitly set them to true for initialized clusters.

When safeguard is true, corresponding *-rm.yml playbooks abort immediately. You can force override via CLI:

./pgsql-rm.yml -l pg-test -e pg_safeguard=false
./etcd-rm.yml  -l etcd    -e etcd_safeguard=false
./minio-rm.yml -l minio   -e minio_safeguard=false

Limiting Execution Scope

Use -l to limit execution targets:

./pgsql.yml -l pg-meta            # run only on pg-meta cluster
./node.yml -l 10.10.10.10         # run only on one node
./redis.yml -l redis-test         # run only on redis-test cluster

For large-scale rollout, validate on one cluster first, then deploy in batches.

Idempotency

Most playbooks are idempotent and safe to rerun, with caveats:

  • infra.yml does not clean data by default; all clean parameters (vmetrics_clean, vlogs_clean, vtraces_clean, grafana_clean, nginx_clean) default to false
  • To rebuild from a clean state, explicitly set relevant clean parameters to true
  • Re-running *-rm.yml deletion playbooks requires extra caution

Task Tags

Use -t to run only selected task subsets:

./pgsql.yml -l pg-test -t pg_service    # refresh services only on pg-test
./node.yml -t haproxy                   # configure haproxy only
./etcd.yml -t etcd_launch               # restart etcd only

Quick Command Reference

INFRA Module

./deploy.yml                     # one-pass full Pigsty deployment
./infra.yml                      # initialize infrastructure
./infra-rm.yml                   # remove infrastructure
./cache.yml                      # build offline package cache
./cert.yml -e cn=<name>          # issue client certificate

NODE Module

./node.yml -l <cls|ip>           # add node
./node-rm.yml -l <cls|ip>        # remove node
bin/node-add <cls|ip>            # add node (wrapper)
bin/node-rm <cls|ip>             # remove node (wrapper)

ETCD Module

./etcd.yml                       # initialize etcd cluster
./etcd-rm.yml                    # remove etcd cluster
bin/etcd-add <ip>                # add etcd member (wrapper)
bin/etcd-rm <ip>                 # remove etcd member (wrapper)

PGSQL Module

./pgsql.yml -l <cls>                             # initialize PostgreSQL cluster
./pgsql-rm.yml -l <cls>                          # remove PostgreSQL cluster
./pgsql-user.yml -l <cls> -e username=<user>     # create business user
./pgsql-db.yml -l <cls> -e dbname=<db>           # create business database
./pgsql-monitor.yml -e clsname=<cls>             # monitor remote cluster
./pgsql-migration.yml -e@files/migration/<cls>.yml  # generate migration runbook
./pgsql-pitr.yml -l <cls> -e '{"pg_pitr": {}}'     # execute PITR recovery

bin/pgsql-add <cls>              # initialize cluster (wrapper)
bin/pgsql-rm <cls>               # remove cluster (wrapper)
bin/pgsql-user <cls> <user>      # create user (wrapper)
bin/pgsql-db <cls> <db>          # create database (wrapper)
bin/pgsql-svc <cls>              # refresh services (wrapper)
bin/pgsql-hba <cls>              # reload HBA (wrapper)
bin/pgmon-add <cls>              # monitor remote cluster (wrapper)

REDIS Module

./redis.yml -l <cls>             # initialize Redis cluster
./redis-rm.yml -l <cls>          # remove Redis cluster

MINIO Module

./minio.yml -l <cls>             # initialize MinIO cluster
./minio-rm.yml -l <cls>          # remove MinIO cluster

FERRET Module

./mongo.yml -l ferret            # install FerretDB

DOCKER Module

./docker.yml -l <host>           # install Docker
./app.yml -e app=<name>          # deploy Docker Compose app

7 - Port List

Default ports used by Pigsty components, with related parameters and status.

This page lists default ports used by Pigsty module components. Adjust as needed or use as a reference for fine-grained firewall configuration.

ModuleComponentPortParameterStatus
NODEnode_exporter9100node_exporter_portEnabled
NODEhaproxy9101haproxy_exporter_portEnabled
NODEvector9598vector_portEnabled
NODEkeepalived_exporter9650vip_exporter_portOptional
NODEchronyd123-Enabled
DOCKERdocker9323docker_exporter_portOptional
INFRAnginx80nginx_portEnabled
INFRAnginx443nginx_ssl_portEnabled
INFRAnginx_exporter9113nginx_exporter_portEnabled
INFRAgrafana3000grafana_portEnabled
INFRAvictoriaMetrics8428vmetrics_portEnabled
INFRAvictoriaLogs9428vlogs_portEnabled
INFRAvictoriaTraces10428vtraces_portEnabled
INFRAvmalert8880vmalert_portEnabled
INFRAalertmanager9059alertmanager_portEnabled
INFRAblackbox_exporter9115blackbox_portEnabled
INFRAdnsmasq53dns_portEnabled
ETCDetcd2379etcd_portEnabled
ETCDetcd2380etcd_peer_portEnabled
MINIOminio9000minio_portEnabled
MINIOminio9001minio_admin_portEnabled
REDISredis6379redis_instancesOptional
REDISredis_exporter9121redis_exporter_portOptional
FERRETferretdb27017mongo_portOptional
FERRETferretdb (TLS)27018mongo_ssl_portOptional
FERRETmongo_exporter9216mongo_exporter_portEnabled
VIBEcode-server8443code_portOptional
VIBEjupyterlab8888jupyter_portOptional
PGSQLpostgres5432pg_portEnabled
PGSQLpgbouncer6432pgbouncer_portEnabled
PGSQLpatroni8008patroni_portEnabled
PGSQLpg_exporter9630pg_exporter_portEnabled
PGSQLpgbouncer_exporter9631pgbouncer_exporter_portEnabled
PGSQLpgbackrest_exporter9854pgbackrest_exporter_portEnabled
PGSQL{{ pg_cluster }}-primary5433pg_default_servicesEnabled
PGSQL{{ pg_cluster }}-replica5434pg_default_servicesEnabled
PGSQL{{ pg_cluster }}-default5436pg_default_servicesEnabled
PGSQL{{ pg_cluster }}-offline5438pg_default_servicesEnabled
PGSQL{{ pg_cluster }}-<service>543xpg_servicesOptional

Public Port Recommendations

If you use firewall zone mode, expose only minimum required ports via node_firewall_public_port:

  • Minimal management surface: 22, 80, 443 (recommended)
  • If public direct DB access is required: additionally expose 5432

Avoid exposing internal component ports directly to the public internet: etcd (2379/2380), patroni (8008), exporters (9xxx), minio (9000/9001), redis (6379), ferretdb (27017/27018), etc.

node_firewall_mode: zone
node_firewall_public_port: [22, 80, 443]
# node_firewall_public_port: [22, 80, 443, 5432]  # only if public DB access is required