PolarDB for PostgreSQL compatible with is officially released. Based on PostgreSQL 16, this version delivers major performance gains in parallel queries, bulk data loading, and logical replication, plus extended SQL/JSON syntax, new monitoring metrics, and flexible access control.
Overview
adds the GanosBase spatial-temporal engine, a global plan cache, and GBK/GB18030 character set support on top of PostgreSQL 16 core functionality. The initial PolarDB for PostgreSQL 16 release supports these extensions: hll, hypopg, log_fdw, pase, pg_bigm, pg_cron, pg_jieba, pg_repack, pg_similarity, pgtap, pgvector, pldebugger, prefix, roaringbitmap, rum, varbitx, zhparser, and ganos.
PolarDB applies instruction-set (SIMD/atomic), system-level (PGO/BOLT/LTO), and I/O optimizations for improved performance.
The PostgreSQL 16 release notes contain the complete list of upstream changes.
Release date
September 18, 2024 (UTC+8).
Billing
The subscription and pay-as-you-go billing methods are supported. Both methods can be combined with compute and storage plans for flexible cost management. For more information, see Billing.
Key improvements
Performance improvements
The new query planner delivers these improvements:
-
Supports parallel execution of
FULLandRIGHTjoins. -
Generates efficient execution plans for aggregations that use
DISTINCTorORDER BYclauses. -
Introduces incremental sorting to improve the performance of SELECT DISTINCT queries.
-
Optimizes window functions to improve the execution efficiency of related queries.
-
Improves the handling of
RIGHTandOUTERanti-joins to enable better identification of rows not present in the joined tables.
PostgreSQL 16 improves single-threaded and concurrent COPY performance by up to 300% for bulk data loading. It adds client-side load balancing for libpq applications and reduces the need for full-table freeze vacuums. SIMD-based CPU acceleration on x86 and ARM speeds up ASCII/JSON string processing, array operations, and subtransaction searches.
Logical replication
Logical replication streams data changes to nodes or subscribers using the PostgreSQL logical replication protocol. supports logical replication from read-only nodes, allowing developers to offload replication work from busy primary nodes.
improves logical replication performance: subscribers can handle large transactions in parallel, use B-tree indexes instead of sequential scans for tables without a primary key, and leverage binary format for faster initial table synchronization.
adds the pg_create_subscription predefined role, granting non-superusers the ability to create logical subscriptions.
supports bidirectional logical replication between two publishers.
Developer experience
extends SQL/JSON syntax with constructors and predicates such as JSON_ARRAY(), JSON_ARRAYAGG(), and IS JSON. Numeric literals support underscores as separators (e.g., 5_432_000) and non-decimal formats (0x1538, 0o12470, 0b1010100111000).
New psql commands include \bind for parameterized queries (e.g., SELECT $1::int + $2::int \bind 1 2 \g).
Text collations default to ICU, with locale auto-detected from the system environment and customizable collation rules.
Monitoring
introduces the pg_stat_io view for detailed I/O access pattern analysis.
The pg_stat_all_tables view gains a last-scan timestamp field. Query parameter values are now recorded, improving auto_explain log readability and tracking accuracy in pg_stat_statements and pg_stat_activity.
Access management and security
adds granular access management and security enhancements. Regular expressions can match database and role entries in pg_hba.conf and pg_ident.conf, and the include directive allows referencing external configuration files.
The following client connection parameters related to security are added:
-
require_auth: specifies the acceptable authentication methods. -
sslrootcert="system": allows libpq to use the system certificate pool for certificate verification.
Kerberos trust delegation allows postgres_fdw and dblink to connect to trusted services with authenticated credentials.
Upgrade
Upgrade your cluster to compatible with to access the latest community features, resources, and best practices.
After upgrading from to , most data types, built-in functions, table columns, and objects remain unchanged. Use logical replication (DTS recommended; Migrate data between PolarDB for PostgreSQL versions) for near-100% compatibility. Key differences:
The following section describes the differences only between 15 and 16. For information about the differences between 14 and 15, see Differences between PostgreSQL 15 and PostgreSQL 14.
Data types
The NULLS NOT DISTINCT indexes cannot be used for primary keys.
Functions and expressions
-
PL/pgSQL bound cursor variable assignment rules changed. In releases earlier than , the string value matched the variable name at cursor assignment. In PostgreSQL 16, values are assigned during OPEN and no longer match the variable name. To restore old behavior, assign the desired
portalname to the cursor variable before OPEN. -
The
pg_walinspectfunctionspg_get_wal_records_info_till_end_of_wal()andpg_get_wal_stats_till_end_of_wal()are removed. -
Restrictions on GENERATED expressions in inherited and partitioned tables are stricter. All columns of parent/partitioned and child/partition tables must have the same generation status. However, the actual generation expressions may differ between them.
-
The REINDEX DATABASE statement and the
reindexdbutility no longer process indexes on system catalogs. You must use the REINDEX SYSTEM statement and thereindexdb --systemutility instead. -
ON SELECT rules can no longer be used to manually create views.
Permissions
-
The new GRANT ... WITH INHERIT clause overrides default role inheritance, allowing per-role control. Previously, a role's inheritance status applied uniformly to all its memberships.
-
CREATEROLE privileges are restricted. In releases earlier than , CREATEROLE roles could change many non-superuser role permissions. In PostgreSQL 16, operations such as adding role members or modifying CREATEDB, REPLICATION, and BYPASSRLS properties require ADMIN OPTION.
Others
-
The
lc_collateandlc_ctyperead-only parameters are removed. -
The
boost_trigger_fileparameter is removed. -
The
vacuum_defer_cleanup_ageparameter is removed. -
The
force_parallel_modeparameter is renamed todebug_parallel_query.