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

ItemOld docs / old defaultCurrent
Kernel baselinePostgreSQL 15PostgreSQL 17
Default PolarDB path/u01/polardb_pg/u01/polardb_pg_17
Supported architecturesx86_64x86_64, aarch64
Available extensionsOld docs said 61pg_available_extensions now returns 93
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 /u01/polardb_pg_17. One important difference is that PolarDB PG still requires the replicator replication user to be SUPERUSER, unlike vanilla PostgreSQL.


Extension List

Most extension plugins from the PGSQL module, especially binary extensions, cannot be reused directly on the PolarDB kernel. If you need them, recompile them specifically for PolarDB 17.

Compared with the old docs, the PolarDB PG 17 extension catalog has changed substantially. The old page body said “61 extensions”, but the old table actually listed 74 entries. Based on the latest SELECT * FROM pg_available_extensions;, the current catalog contains 93 available extensions.

Change TypeCountNotes
Added33New additions include pgaudit, pg_partman, pg_profile, pg_repack, pg_stat_kcache, pg_jieba, pg_cron, pg_hint_plan, pg_walinspect, plus PolarDB and operations-focused extensions such as polar_advisor, polar_feature_utils, polar_parameter_manager, polar_proxy_utils, polar_resource_manager, and polar_smgrperf.
Removed14polar_csn, polar_px, polar_stat_env, polar_stat_sql, timetravel, and smlar no longer appear in the current PG17 catalog. Several plpython2u / plpythonu compatibility extensions were also removed.

The latest full PolarDB PG 17 extension list is shown below, ordered by the pg_available_extensions query result:

namedefault_versioncomment
pg_jieba1.1.0a parser for full-text search of Chinese
polar_monitor1.3monitor functions for PolarDB
plpgsql1.0PL/pgSQL procedural language
cube1.5data type for multidimensional cubes
bool_plperl1.0transform between bool and plperl
pg_partman5.2.4Extension to manage partitioned tables by time or ID
pg_buffercache1.6examine the shared buffer cache
pgaudit17.1provides auditing functionality
pg_profile4.10PostgreSQL load profile repository and report builder
pg_stat_statements1.11track planning and execution statistics of all SQL statements executed
plperlu1.0PL/PerlU untrusted procedural language
fuzzystrmatch1.2determine similarities and distance between strings
pltcl1.0PL/Tcl procedural language
jsonb_plpython3u1.0transform between jsonb and plpython3u
polar_parameter_manager1.2Extension to select parameters for manager.
sequential_uuids1.0.3generator of sequential UUIDs
unaccent1.1text search dictionary that removes accents
autoinc1.0functions for autoincrementing fields
plpython3u1.0PL/Python3U untrusted procedural language
amcheck1.4functions for verifying relation integrity
pg_cron1.5Job scheduler for PostgreSQL
polar_advisor1.1polar_advisor
tsm_system_rows1.0TABLESAMPLE method which accepts number of rows as a limit
pase0.0.1ant ai similarity search
pg_squeeze1.9A tool to remove unused space from a relation.
dict_xsyn1.0text search dictionary template for extended synonym processing
prefix1.2.0Prefix Range module for PostgreSQL
ip4r2.4
ltree1.3data type for hierarchical tree-like structures
btree_gist1.7support for indexing common datatypes in GiST
hstore_plpython3u1.0transform between hstore and plpython3u
pg_cron_preload1.0polardb pg extend catalog
tablefunc1.0functions that manipulate whole tables, including crosstab
refint1.0functions for implementing referential integrity (obsolete)
pgtap1.3.3Unit testing for PostgreSQL
pgstattuple1.5show tuple-level statistics
polar_smgrperf1.0smgr perf test extension
pg_repack1.5.1-1Reorganize tables in PostgreSQL databases with minimal locks
file_fdw1.0foreign-data wrapper for flat file access
pg_stat_kcache2.3.0Kernel statistics gathering
pgcrypto1.3cryptographic functions
hll2.18type for storing hyperloglog data
pgrowlocks1.2show row-level locking information
intagg1.1integer aggregator and enumerator (obsolete)
sslinfo1.2information about SSL certificates
pg_trgm1.6text similarity measurement and index searching based on trigrams
isn1.2data types for international product numbering standards
ltree_plpython3u1.0transform between ltree and plpython3u
hstore1.8data type for storing sets of (key, value) pairs
hstore_plperlu1.0transform between hstore and plperlu
log_fdw1.4foreign-data wrapper for Postgres log file access
dblink1.2connect to other PostgreSQL databases from within a database
btree_gin1.3support for indexing common datatypes in GIN
dict_int1.0text search dictionary template for integers
polar_worker1.1polar_worker
polar_resource_manager1.0a background process that forcibly frees user session process memory
insert_username1.0functions for tracking who changed a table
polar_feature_utils1.0PolarDB feature utilization
polar_vfs1.0polar virtual file system for different storage
uuid-ossp1.1generate universally unique identifiers (UUIDs)
pg_walinspect1.1functions to inspect contents of PostgreSQL Write-Ahead Log
pldbgapi1.1server-side support for debugging PL/pgSQL functions
earthdistance1.2calculate great-circle distances on the surface of the Earth
polar_tde_utils1.0Internal extension for TDE
pageinspect1.12inspect the contents of database pages at a low level
seg1.4data type for representing line segments or floating-point intervals
pg_freespacemap1.2examine the free space map (FSM)
bloom1.0bloom access method - signature file based index
pg_similarity1.0support similarity queries
tsm_system_time1.0TABLESAMPLE method which accepts time in milliseconds as a limit
polar_monitor_preload1.0examine the polardb information
pg_bigm1.2text similarity measurement and index searching based on bigrams
pg_visibility1.2examine the visibility map (VM) and page-level visibility info
pg_surgery1.0extension to perform surgery on a damaged relation
pg_hint_plan1.7.0optimizer hints for PostgreSQL
postgres_fdw1.1foreign-data wrapper for remote PostgreSQL servers
lo1.1Large Object maintenance
polar_io_stat1.0polar io stat in multi dimension
jsonb_plperlu1.0transform between jsonb and plperlu
moddatetime1.0functions for tracking last modification time
pg_prewarm1.2prewarm relation data
plperl1.0PL/Perl procedural language
citext1.6data type for case-insensitive character strings
xml21.1XPath querying and XSLT
tcn1.0Triggered change notifications
bool_plperlu1.0transform between bool and plperlu
roaringbitmap0.5support for Roaring Bitmaps
polar_proxy_utils1.0Extension to provide operations about proxy.
hstore_plperl1.0transform between hstore and plperl
jsonb_plperl1.0transform between jsonb and plperl
varbitx1.1varbit functions pack
pltclu1.0PL/TclU untrusted procedural language
intarray1.5functions, operators, and index support for 1-D arrays of integers
  • Pigsty Professional Edition provides PolarDB offline installation support, extension plugin compilation support, and monitoring and management support specifically adapted for PolarDB clusters.
  • Pigsty collaborates with the Alibaba Cloud kernel team and can provide paid kernel backup support services.

Last Modified 2026-04-17: update docs format (58f5ac7)