PolarDB PG

Using Alibaba Cloud’s open-source PolarDB for PostgreSQL kernel to provide domestic innovation qualification support, with Oracle RAC-like user experience.

Overview

Pigsty allows you to create PostgreSQL clusters with “domestic innovation qualification” credentials using PolarDB!

PolarDB for PostgreSQL now uses PostgreSQL 17 as its base. The polar template, default path, and extension notes in Pigsty have all been updated to PG17. Any client tool compatible with the PostgreSQL wire protocol can access PolarDB clusters.

Pigsty’s PGSQL repository provides PolarDB PG open-source installation packages, but they are not downloaded to the local software repository during Pigsty installation.


Installation

Use the built-in Pigsty template:

./configure -c polar
./deploy.yml

Change Summary

Starting with Pigsty v4.4, the PolarDB PG kernel uses packages built and maintained by Pigsty. The main changes are:

ItemOld docs / old defaultCurrent
Kernel baselinePostgreSQL 15PostgreSQL 17
Default PolarDB path/u01/polardb_pg/usr/polar-17
Supported architecturesx86_64x86_64, aarch64
Available extensionsOld docs said 61pg_available_extensions returns 93; 34 remain after filtering contrib
Replication user requirementreplicator must be SUPERUSERunchanged

Configuration

The following parameters need special configuration for PolarDB database clusters:

#----------------------------------#
# PGSQL & PolarDB
#----------------------------------#
pg_version: 17
pg_mode: polar
pg_packages: [ polardb, pgsql-common ]
pg_exporter_exclude_database: 'template0,template1,postgres,polardb_admin'
pg_default_roles:
  - { name: dbrole_readonly  ,login: false ,comment: role for global read-only access     }
  - { name: dbrole_offline   ,login: false ,comment: role for restricted read-only access }
  - { name: dbrole_readwrite ,login: false ,roles: [dbrole_readonly] ,comment: role for global read-write access }
  - { name: dbrole_admin     ,login: false ,roles: [pg_monitor, dbrole_readwrite] ,comment: role for object creation }
  - { name: postgres     ,superuser: true  ,comment: system superuser }
  - { name: replicator   ,superuser: true  ,replication: true ,roles: [pg_monitor, dbrole_readonly] ,comment: system replicator } # <- superuser is required for replication
  - { name: dbuser_dba   ,superuser: true  ,roles: [dbrole_admin]  ,pgbouncer: true ,pool_mode: session, pool_connlimit: 16 ,comment: pgsql admin user }
  - { name: dbuser_monitor ,roles: [pg_monitor] ,pgbouncer: true ,parameters: {log_min_duration_statement: 1000 } ,pool_mode: session ,pool_connlimit: 8 ,comment: pgsql monitor user }

The default installation directory for the polar kernel has moved to /usr/polar-17. One important difference is that PolarDB PG still requires the replicator replication user to be SUPERUSER, unlike vanilla PostgreSQL.


Available Extensions

The PolarDB PG kernel has 93 available extensions. After removing bundled PG Contrib extensions, the following extra extensions remain:

ExtensionVersionDescription
hll2.18type for storing hyperloglog data
ip4r2.4
log_fdw1.4foreign-data wrapper for Postgres log file access
pase0.0.1ant ai similarity search
pg_bigm1.2text similarity measurement and index searching based on bigrams
pg_cron1.5Job scheduler for PostgreSQL
pg_cron_preload1.0polardb pg extend catalog
pg_hint_plan1.7.0optimizer hints for PostgreSQL
pg_jieba1.1.0a parser for full-text search of Chinese
pg_partman5.2.4Extension to manage partitioned tables by time or ID
pg_profile4.10PostgreSQL load profile repository and report builder
pg_repack1.5.1-1Reorganize tables in PostgreSQL databases with minimal locks
pg_similarity1.0support similarity queries
pg_squeeze1.9A tool to remove unused space from a relation.
pg_stat_kcache2.3.0Kernel statistics gathering
pgaudit17.1provides auditing functionality
pgtap1.3.3Unit testing for PostgreSQL
pldbgapi1.1server-side support for debugging PL/pgSQL functions
polar_advisor1.1polar_advisor
polar_feature_utils1.0PolarDB feature utilization
polar_io_stat1.0polar io stat in multi dimension
polar_monitor1.3monitor functions for PolarDB
polar_monitor_preload1.0examine the polardb information
polar_parameter_manager1.2Extension to select parameters for manger.
polar_proxy_utils1.0Extension to provide operations about proxy.
polar_resource_manager1.0a background process that forcibly frees user session process memory
polar_smgrperf1.0smgr perf test extension
polar_tde_utils1.0Internal extension for TDE
polar_vfs1.0polar virtual file system for different storage
polar_worker1.1polar_worker
prefix1.2.0Prefix Range module for PostgreSQL
roaringbitmap0.5support for Roaring Bitmaps
sequential_uuids1.0.3generator of sequential UUIDs
varbitx1.1varbit functions pack

Last Modified: 2026-07-11: update app docs (3c08288)