PolarDB for PostgreSQL compatible with PostgreSQL 17 is officially released. PostgreSQL 17 enhances database usability and efficiency by improving performance, simplifying O&M, and expanding features.
Overview
PolarDB for PostgreSQL 17 provides various features, such as the GanosBase spatial-temporal engine, a global plan cache mechanism, and the GBK/GB18030 character set, in addition to PostgreSQL 17 functionalities. The first release of PolarDB for PostgreSQL 17 supports the following plug-ins to extend the database’s functionalities: hll, log_fdw, mysql_fdw, pase, pg_bigm, pg_cron, pg_jieba, pg_repack, pg_similarity, pgtap, pgvector, pldebugger, prefix, varbitx, zhparser, and ganos.
PolarDB implements extensive performance optimizations, including instruction set optimizations (SIMD/atomic operations), system-level optimizations (PGO/BOLT/LTO), and I/O performance improvements.
For more information, see PostgreSQL 17 release notes.
Release date
April 3, 2025 (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
Reduced memory consumption of the vacuum process: The vacuum process is critical to the health of the PostgreSQL database. However, it consumes a lot of cluster resources. PostgreSQL 17 introduces a new internal memory structure for vacuum operations to decrease memory consumption by up to 20 times. This accelerates the vacuum process, decreases its usage of shared resources, and frees up more resources for other workloads.
Improved I/O performance: PostgreSQL 17 improves write-ahead logging (WAL) processing and doubles the write throughput in high-concurrency scenarios. The new streaming I/O interface accelerates sequential scans (full table scans) and ANALYZE operations.
Improved query performance: PostgreSQL 17 improves the performance of
INclause queries with B-tree indexes (default indexing method in PostgreSQL). This release also supports the parallel building of block range indexes (BRINs). PostgreSQL 17 improves query planning and optimizesNOT NULLconstraints and common table expressions (WITH queries). This release uses more Single Instruction/Multiple Data (SIMD) instructions to accelerate computations, including using AVX-512 to accelerate thebit_countfunction.
Developer experience
PostgreSQL was the first relational database to introduce native JSON support in 2012 and has continuously improved the implementation of the SQL/JSON standard in PostgreSQL 17.
Introduces the JSON_TABLE() function to convert JSON data into standard PostgreSQL tables.
Introduces SQL/JSON constructor functions
JSON,JSON_SCALAR, andJSON_SERIALIZEand query functionsJSON_EXISTS,JSON_QUERY, andJSON_VALUEto give developers more ways to interact with JSON data.Adds more JSONPath expressions to convert JSON data to native PostgreSQL data types, including numbers, booleans, strings, and dates/times.
PostgreSQL 17 adds more functionalities to the MERGE statement, including the
RETURNINGclause for conditional updates and the ability to update views.PostgreSQL 17 adds new features that improve batch loading and data export. Exporting large rows by using the COPY statement is now up to two times faster. When the source encoding matches the target encoding, the
COPYstatement performs more efficiently. Additionally, theON_ERRORoption is introduced to ensure an uninterrupted import process even if insertion errors occur.PostgreSQL 17 extends the capabilities for managing partitioned data and data distributed across remote PolarDB PostgreSQL clusters. This release supports identity columns and exclusion constraints in partitioned tables. The PostgreSQL foreign data wrapper (postgres_fdw) supports pushing down
EXISTSandINsubqueries to remote servers for more efficient query processing.PostgreSQL 17 introduces a built-in, cross-platform, and guaranteed immutable collation provider. This provider has the same sorting semantics as the
Ccollation but usesUTF-8encoding instead ofSQL_ASCII. It also ensures that text-based queries return consistent sorting results, regardless of the platform used by PostgreSQL.
Logical replication
Logical replication is essential for real-time data streaming in various scenarios. In releases earlier than PostgreSQL 17, the logical replication slots must be removed before a major version upgrade. As a result, subscriber data must be resynchronized after the upgrade. Starting from PostgreSQL 17, a major upgrade can be performed without removing logical replication slots.
PostgreSQL 17 introduces failover control for logical replication and enhances reliability in high-availability environments. This release introduces the pg_createsubscriber command-line tool, which facilitates logical replication on replicas that use physical replication.
Security and operation management options
PostgreSQL 17 improves how users manage their database systems throughout the entire lifecycle. PolarDB for PostgreSQL introduces a new Transport Layer Security (TLS) option called
sslnegotiation. It allows users to perform a direct TLS handshake when using Application-Layer Protocol Negotiation (ALPN), withpostgresqlregistered in the ALPN directory.PostgreSQL 17 adds the
pg_maintainrole, which allows users to perform maintenance operations.The native PostgreSQL backup tool
pg_basebackupof PostgreSQL 17 supports incremental backups. Thepg_combinebackuptool is added to reconstruct full backups. The--filteroption is added to thepg_dumptool to allow users to specify the objects to include in the dump.PostgreSQL 17 also enhances monitoring and analysis capabilities.
The time spent on local I/O block reads and writes is displayed in the EXPLAIN statement. The statement also includes two new options, namely,
SERIALIZEandMEMORY, which show the time spent on data conversion during network transmission and the memory usage, respectively.The index cleanup progress can be viewed. The
pg_wait_eventssystem view is added. Together with thepg_stat_activityview, this new view can help you better understand why active sessions are waiting.
Upgrade
We recommend that you upgrade your cluster to PolarDB for PostgreSQL 17. After you upgrade your cluster to PolarDB for PostgreSQL compatible with PostgreSQL 17, you can keep up with the PostgreSQL community and get more resources and support to solve issues and learn best practices for databases.
After you upgrade your cluster from PolarDB for PostgreSQL 16 to PolarDB for PostgreSQL 17, most data types, built-in functions, table columns, and objects remain unchanged. Therefore, you do not have to worry about complex changes when navigating the technical improvements. You can use logical replication to achieve near 100% compatibility. (DTS is recommended. For more information, see Migrate data between PolarDB for PostgreSQL versions). The following sections describe the improvements.
The following section describes the difference between PolarDB for PostgreSQL 17 and PolarDB for PostgreSQL 16. For information about the differences between another PolarDB for PostgreSQL release and PolarDB for PostgreSQL 16, see Differences between PostgreSQL 16 and PostgreSQL 15 and Differences between PostgreSQL 15 and PostgreSQL 14.
Data types
agoappears only at the end of interval values.Multiple empty interval units are not allowed.
Views
The
pgrowlockslock mode output labels are updated.Shareis changed toFor ShareandKey Shareis changed toFor Key Share.The file boundary handling of two WAL file name functions is updated. In releases earlier than PostgreSQL 17, the
pg_walfile_name()andpg_walfile_name_offset()functions return the previous LSN segment number when an LSN is on a file segment boundary. In PostgreSQL 17, the two functions return the current LSN segment.The
domain_defaultfield is removed from the element_types table in theinformation_schema.The I/O block read/write timing statistics columns of
pg_stat_statementsare renamed. Theblk_read_timecolumn is renamed toshared_blk_read_timeand theblk_write_timecolumn is renamed toshared_blk_write_time.The representation of the default statistics target is changed. The
pg_attribute.attstattargetandpg_statistic_ext.stxstattargetcolumns use NULL to represent their default statistics targets.The localization-related columns are renamed. The
pg_collation.colliculocalecolumn is renamed tocolllocaleand thepg_database.daticulocalecolumn is renamed todatlocale.The columns that track the progress of VACUUM operations are reconstructed. The
max_dead_tuplescolumn is renamed tomax_dead_tuple_bytes, thenum_dead_tuplescolumn is renamed tonum_dead_item_ids, and thedead_tuple_bytescolumn is added.The SLRU-related statistics columns are renamed. The
pg_stat_slrusystem view and the column names accepted by thepg_stat_reset_slru()function are changed.
Functions and expressions
Functions are required to use a safe search_path during maintenance operations (ANALYZE, CLUSTER, CREATE INDEX, CREATE MATERIALIZED VIEW, REFRESH MATERIALIZED VIEW, REINDEX, or VACUUM) to prevent unauthorized access. Functions used by expression indexes and materialized views that need to reference non-default schemas must specify a search path upon creation.
Permissions
The SET SESSION AUTHORIZATION handling of the initial session user's superuser status is updated. The new handling is based on the session user's superuser status when the SET SESSION AUTHORIZATION command is run, not the superuser status at the connection time.
The
db_user_namespacefeature that simulates per-database users is removed due to rare use.
Others
The
old_snapshot_thresholdserver parameter is removed. This parameter allows the vacuum process to remove rows that may still be visible to a running transaction, causing asnapshot too oldwhen accessed later.The
adminpackextension is removed. This extension was used by pgAdmin III, which has reached end of life (EOL).The
trace_recovery_messagesserver parameter is removed.