Kernel Version
Choosing a “kernel” in Pigsty means determining the PostgreSQL major version, mode/distribution, packages to install, and tuning templates to load.
The Pigsty v4.5 source supports PostgreSQL 14-18 and uses 18 by default. Use the following configuration settings to select a kernel.
Major Version and Packages
pg_version: Select the PostgreSQL major version. The default is 18. Pigsty maps the version to the correct package name prefix.pg_packages: Select core packages with package aliases. The default,pgsql-main pgsql-common, includes the kernel, Patroni, PgBouncer, pgBackRest, and other common tools.pg_extensions: Select additional extension packages. Aliases are supported. The default is empty, which installs only core dependencies.
During installation, Ansible downloads packages for
pg_version=18and installs extension files on the system. Database initialization scripts can then runCREATE EXTENSION.
Extension availability differs between versions in Pigsty’s offline repository.
PostgreSQL 14 has fewer extensions, while 17/18 have the widest coverage.
If an extension is not included, add it through repo_extra_packages.
Kernel Mode (pg_mode)
pg_mode selects the kernel distribution.
The default, pgsql, selects standard PostgreSQL.
Pigsty supports these modes:
| Mode | Scenario |
|---|---|
pgsql | Standard PostgreSQL, HA + replication |
citus | Citus distributed cluster, requires additional pg_shard / pg_group |
gpsql | Cloudberry / Greenplum / MatrixDB |
mssql | Babelfish |
mysql | OpenGauss/HaloDB compatible with MySQL protocol |
polar | Alibaba PolarDB (based on pg polar distribution) |
ivory | IvorySQL (Oracle-compatible syntax) |
pgtde | Percona PostgreSQL with pg_tde under /usr/pgtde-$v |
oriole | OrioleDB storage engine |
agens | AgensGraph graph database kernel |
pgedge | pgEdge distributed replication kernel |
pg_mode selects binary paths, Patroni integration, and some kernel-specific behavior.
It does not automatically add every required package, extension, and application database.
For deployment, use the matching conf/*.yml template.
Alternatively, set pg_packages, pg_extensions, pg_libs, and pg_databases explicitly.
This is a minimal Citus example:
conf/ha/citus.ymlprovides the current complete example. The example above explicitly installs Citus packages and creates the extension in thecitusdatabase.
Extensions and Pre-installed Objects
Use these parameters to control components loaded automatically after database startup:
pg_libs: List to write toshared_preload_libraries. For example:pg_libs: 'timescaledb, pg_stat_statements, auto_explain'.pg_default_extensions/pg_default_schemas: Control schemas and extensions pre-created intemplate1andpostgresby initialization scripts.pg_parameters: Rendered by Pigsty intopostgresql.auto.confduring configuration. Do not also manage the same settings manually withALTER SYSTEM.
Example: Enable TimescaleDB, pgvector and customize some system parameters.
During initialization, Pigsty creates default extensions in
template1andpostgres. New databases based ontemplate1inherit these objects. Pigsty writespg_parametersdirectly topostgresql.auto.conf.
Tuning Template (pg_conf)
pg_conf selects a Patroni template from roles/pgsql/templates/*.yml.
Pigsty includes four general templates:
| Template | Applicable Scenario |
|---|---|
oltp.yml | Default template, for 4–128 core TP workload |
olap.yml | Optimized for analytical scenarios |
crit.yml | Emphasizes sync commit/minimal latency, suitable for zero-loss scenarios like finance |
tiny.yml | Lightweight machines / edge scenarios / resource-constrained environments |
You can replace the template or customize a YAML file in templates/.
Then select it in the cluster vars.
Pigsty uses
crit.ymlas the Patroni configuration and writespg_parametersoverrides topostgresql.auto.conf. The instances then use synchronous commit immediately.
Combined Instance: A Complete Example
- First primary + one replica, using
olap.ymltuning. - Install PG18 plus common RAG extensions; only libraries that actually require preloading belong in
pg_libs. - Patroni/pgbouncer/pgbackrest generated by Pigsty, no manual intervention needed.
Adjust these parameters for the application requirements to customize the kernel configuration.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)