PostgreSQL 17 New Features
PostgreSQL 17 New Features
WITH EXAMPLES · ENGLISH SOURCE EDITION
Explore the features, SQL examples, and compatibility changes documented by Noriyoshi Shinoda.
Contents
Reference indexes
The opening chapter includes the first numbered table, Table 1. The indexes below collect the book’s other native numbered components.
Tables
- Table 1 — Version
- Table 2 — Examples of notation
- Table 3 — Syntax rules
- Table 4 — Removed options
- Table 5 — Modes column output
- Table 6 — Add system catalogs and views
- Table 7 — System catalogs/views with additional columns
- Table 8 — System catalogs/views with removed columns
- Table 9 — System catalogs/views with changed columns name
- Table 10 — View which in information_schema schema with removed column name
- Table 11 — System catalogs/views with modified output
- Table 12 — The pg_wait_events view
- Table 13 — The pg_stat_checkpointer view
- Table 14 — WAL summary retrieval functions
- Table 15 — Possible values for the option
- Table 16 — Added functions
- Table 17 — Added functions
- Table 18 — Added functions
- Table 19 — Added functions
- Table 20 — Added functions
- Table 21 — Added functions
- Table 22 — Added functions
- Table 23 — Added Wait Events
- Table 24 — Renamed wait event
- Table 25 — Available value for the ON_ERROR option
- Table 26 — Available value for the LOG_VERBOSITY option
- Table 27 — Available value for the SERIALIZE option
- Table 28 — Added JSONPATH methods
- Table 29 — Changed Element Name
- Table 30 — Added parameters
- Table 31 — Possible values
- Table 32 — Modified Parameters
- Table 33 — Parameters with default values changed
- Table 34 — Removed parameters
- Table 35 — Add/change options
- Table 36 — Major options
- Table 37 — Major options
- Table 38 — Object type
- Table 39 — Available options
- Table 40 — Renamed options
- Table 41 — Possible values for option
- Table 42 — Added function
- Table 43 — Added columns
- Table 44 — Removed column
- Table 45 — Added functions
- Table 46 — Added function
- Table 47 — Added functions
- Table 48 — Added functions
- Table 49 — Added modules
Examples
- Example 1 — Behavior of PostgreSQL 16.2
- Example 2 — Behavior of PostgreSQL 17
- Example 3 — PostgreSQL 16 output
- Example 4 — PostgreSQL 17 output
- Example 5 — Execution result of pgrowlocks function
- Example 6 — Reference to the pg_wait_events view
- Example 7 — Reference to the pg_stat_checkpointer view
- Example 8 — Log when streaming replication standby instance downs
- Example 9 — Creating the Replication Slot with Failover Attribute
- Example 10 — Create SUBSCRIPTION with FAILOVER attribute
- Example 11 — Synchronization error log for replication slots
- Example 12 — Replication slot synchronization success log
- Example 13 — Forced synchronization of replication slots
- Example 14 — WAL summary files
- Example 15 — Functions for WAL summary information
- Example 16 — Execute the incremental backup
- Example 17 — Merge backup data
- Example 18 — Manifest file enhancements
- Example 19 — Check the system ID
- Example 20 — Allow exclude constraints
- Example 21 — Supports for IDENTITY column
- Example 22 — Behavior of PostgreSQL 16
- Example 23 — Grant MAINTAIN privilege
- Example 24 — Execution privilege of pg_current_logfile function
- Example 25 — Specifying a builtin locale provider
- Example 26 — Publishing login event trigger
- Example 27 — Generate REINDEX event trigger (REINDEX start)
- Example 28 — Generate REINDEX event trigger (REINDEX finish)
- Example 29 — Logging for trust connection (PostgreSQL 16)
- Example 30 — Logging for trust connection (PostgreSQL 17)
- Example 31 — Replication slot logging
- Example 32 — Recovery logging
- Example 33 — The part of wait_event_names.txt
- Example 34 — Estimated number of tuples in PostgreSQL 17
- Example 35 — Estimated number of tuples in PostgreSQL 16
- Example 36 — Attribute modification by ALTER OPERATOR statement
- Example 37 — ALTER SYSTEM statement to change parameters for extensions
- Example 38 — Change access method
- Example 39 — Specifying the SET EXPRESSION clause
- Example 40 — Specifying the SET STATISTICS clause
- Example 41 — CLUSTER with VERBOSE clause
- Example 42 — Specifying the FORCE_NULL * option
- Example 43 — Specifying the ON_ERROR option
- Example 44 — Specifying the LOG_VERBOSITY option
- Example 45 — Specifying the access method
- Example 46 — EXPLAIN statement in JSON format
- Example 47 — EXPLAIN statement with MEMORY clause
- Example 48 — EXPLAIN statement with SERIALIZE clause
- Example 49 — Specifying the BY SOURCE clause
- Example 50 — MERGE statement with the RETURNING clause
- Example 51 — MERGE statement for updatable views
- Example 52 — %TYPE attribute and %ROWTYPE attribute
- Example 53 — Execution error occurs in PostgreSQL 16
- Example 54 — INTERVAL type and Infinity
- Example 55 — Specify the AT LOCAL clause
- Example 56 — Behavior of PostgreSQL 17
- Example 57 — Behavior of PostgreSQL 16
- Example 58 — Added JSON constructor
- Example 59 — JSONPATH methods
- Example 60 — Timestamp with Time zone
- Example 61 — JSON query
- Example 62 — Execute JSON_TABLE function
- Example 63 — Execute jsonb_populate_record_valid function
- Example 64 — Execute pg_basetype function
- Example 65 — Execute random function
- Example 66 — Execute to_bin / to_oct function
- Example 67 — Execute to_regtypemod function
- Example 68 — Execute to_timestamp function with TZ/OF
- Example 69 — Execute UNICODE related functions
- Example 70 — Execute on EUC_JP encoded database
- Example 71 — Execute xmltext function
- Example 72 — Execute UUID related functions
- Example 73 — Execute pg_column_toast_chunk_id function
- Example 74 — Execution Plan on PostgreSQL 17
- Example 75 — Execution Plan on PostgreSQL 16
- Example 76 — Execution Plan on PostgreSQL 17
- Example 77 — Execution Plan on PostgreSQL 16
- Example 78 — Execution Plan on PostgreSQL 17
- Example 79 — Execution Plan on PostgreSQL 16
- Example 80 — Execution Plan on PostgreSQL 17
- Example 81 — Execution Plan on PostgreSQL 16
- Example 82 — Execution Plan on PostgreSQL 17
- Example 83 — Execution Plan on PostgreSQL 16
- Example 84 — Permission to execute ALTER SYSTEM statement
- Example 85 — Transaction timeout
- Example 86 — Specifying the --all and --table options
- Example 87 — Execution log of configure command
- Example 88 — Specifying the builtin locale provider
- Example 89 — Execute pg_combinebackup command
- Example 90 — Execute pg_createsubscriber command
- Example 91 — Add dbname to primary_conninfo parameter
- Example 92 — --help option outputs
- Example 93 — --filter option
- Example 94 — Specifying the --transaction-size option
- Example 95 — --help option output
- Example 96 — Execute the pg_walsummary command
- Example 97 — View function information
- Example 98 — Ignore the semicolon at the end of the line
- Example 99 — Specify the minimum number of tuples
- Example 100 — Specifying --all and --schema options
- Example 101 — Specify --index and --jobs options
- Example 102 — Specifying --all and --exclude-schema options
- Example 103 — Specify option --sync-method
- Example 104 — Specify checkunique parameter
- Example 105 — Specify --checkunique option
- Example 106 — Constant SAVEPOINT statement
- Example 107 — Constant CALL statement
- Example 108 — Constant PREPARE statement and COMMIT statement
- Example 109 — Reset min/max values
- Example 110 — Execution Plan on PostgreSQL 17
- Example 111 — Execution Plan on PostgreSQL 16
- Example 112 — Using hash indexes for ltree types
- Example 113 — Using the test_radixtree extension
- Example 114 — Burn through lots of transaction ID
Figures
Source edition
The source chapter order, wording, examples, and publication credits are retained. PDF page markers link the reading edition to the original document. Source identity and coverage · About the collection
1 About This Document
PDF page 5
1.1 Purpose
The purpose of this document is to provide information about the major new features of open-source RDBMS PostgreSQL 17 (17.0).
1.2 Audience
This document is written for engineers who already know PostgreSQL, such as installation, basic management, etc.
1.3 Scope
This document describes the major difference between PostgreSQL 16 (16.4) and PostgreSQL 17 (17.0). As a general rule, this document examines the features of behavior change. This document does not describe and verify all new features. In particular, the following new features are not included.
Bugfix
Performance improvement by changing internal behavior
Improvement of regression test
Operability improvement by the psql command tab input
Improvement of the pgbench command
Improvement of documentation, modify typos in the source code
Refactoring without a change in behavior
1.4 Software Version
The contents of this document have been verified for the following versions and platforms.
PDF page 6
| Software | Version |
|---|---|
| PostgreSQL | PostgreSQL 16.4 (for comparison) PostgreSQL 17 (17.0) (September 23, 2024 8:05 p.m.) |
| Operating System | Red Hat Enterprise Linux 8 Update 5 (x86-64) |
| Configure options | –with-ssl=openssl –with-lz4 –with-zstd –with-llvm –with-libxml –with-icu –enable-injection-points |
1.5 The Question, comment, and Responsibility
The contents of this document are not an official opinion of Hewlett Packard Enterprise Japan, G.K. The author and affiliation company do not take any responsibility for the problem caused by the mistake of contents. If you have any comments for this document, please contact Noriyoshi Shinoda (noriyoshi.shinoda@hpe.com), Hewlett Packard Enterprise Japan, G.K.
1.6 Notation
This document contains examples of the execution of the command or SQL statement. Execution examples are described according to the following rules:
| Notation | Description |
|---|---|
| # | Shell prompt for Linux root user. |
| $ | Shell prompt for Linux general user. |
| Bold | The user input string. |
| postgres=# | The psql command prompt used by PostgreSQL users with the SUPERUSER attribute. |
| postgres=> | The psql command prompt used by PostgreSQL users without the SUPERUSER attribute. |
| Underline | Important output items. |
| «PASSWORD» | Replaced by password string. |
| … | Indicates that it is omitted. |
The syntax is described in the following rules:
PDF page 7
| Notation | Description |
|---|---|
| Italic | Replaced by the name of the object which users use, or the other syntax. |
| [ ] | Indicate that it can be omitted. |
| { A | B } | Indicate that it is possible to select A or B. |
| … | General syntax. It is the same as the previous version. |
2 New Features Summary
PDF page 8
More than 200 new features have been added to PostgreSQL 17. This chapter provides an overview of typical new features and benefits. Details of the new features will be explained in “3. New Feature Detail”.
2.1 Improvements to adapt to large scale environments
The following features have been added that can be applied to large scale environments:
Incremental Backup
Incremental backups are now supported as a standard feature of PostgreSQL. pg_basebackup command now has an option to take incremental backups. To perform an incremental backup, the manifest of the base-backup is used to determine the incremental backup. New command pg_combinebackup merges the base and incremental backups.
Supports large-scale memory
The SLRU cache is divided into multiple banks, which is expected to reduce the lock range and improve cache search speed. Additionally, several parameters have been added to determine the size of each SLRU memory region.
2.2 Improved reliability
PostgreSQL 17 implements the following enhancements to improve reliability.
Logical Replication Slot Synchronization
The replication slot information used for logical replication can now be synchronized to the standby server for streaming replication.
Wait for Streaming Replication
The feature has been added to wait for logical replication updates until change data has been sent to the standby server for streaming replication.
PDF page 9
2.3 Improved maintainability
The following features that can improve operability have been added.
Checkpointer Statistics
The pg_stat_checkpointer view has been added to retrieve checkpointer process statistics. some columns in the pg_stat_checkpointer view have been moved from the pg_stat_bgwriter view.
Enhancement of the parameter files
The maximum length of token names that can be used in the pg_hba.conf and pg_ident.conf files has been changed from 256 bytes to unlimited.
MAINTAIN privilege
The MAINTAIN privilege has been added to perform maintenance operations such as VACUUM, ANALYZE, and REINDEX statements. The pg_maintain predefined role has been added to allow maintenance operations on objects for all users.
Login event trigger
The login event trigger is now available that executes upon successful authentication.
2.4 Improvements in Programming
The following functions have been added to SQL statements.
JSON-related
Multiple JSON constructors and many JSONPATH methods have been added. Also added JSON_EXISTS, JSON_QUERY, JSON_VALUE, and JSON_TABLE functions.
COPY statement
An option has been added to continue processing in the occurrence of data type conversion errors.
MERGE statement
The MERGE statement now supports updatable views. Also, the RETURNING clause and BY SOURCE clause can now be specified.
PDF page 10
PL/pgSQL
Variable declarations can now specify arrays for the %TYPE and %ROWTYPE attributes, which indicate the data type of table columns and tuples as a whole.
2.5 Preparing for future new features
PostgreSQL 17 is now ready for features that will be provided in future versions.
Wait Event view
The pg_wait_events view has been added to retrieve the names of wait events. Currently, only the name and description of the wait event is available. In the future, it is expected to acquire the cumulative time of wait events, etc.
Providing new I/O methods
The foundation for using asynchronous I/O and multiple block I/O is now provided.
2.6 Incompatibility
In PostgreSQL 17, the following specifications have been changed from PostgreSQL 16.
2.6.1 End of support
PostgreSQL 17 changed the supported versions for the following platforms and tools. [1301c80, 8e278b6, 820b5af, 0b16bb8, cc09e65] The platforms and tools that are no longer supported are listed below.
Microsoft Visual Studio
LLVM 9 or earlier
IBM AIX
adminpack contrib module Changes in supported versions of components required to build PostgreSQL 17 are as follows.
OpenSSL 1.0.2 or later
LLVM 10 or later
PDF page 11
2.6.2 Configure command
The following configure command options have been removed. [68a4b58, 1c1eec0]
| Option | Description | Note |
|---|---|---|
| –disable-thread-safety | Disable thread safety for client libraries | |
| –with-CC | Compiler specification (deprecated since July 2000) |
2.6.3 MERGE statement
The SELECT privilege on the target table is now required even when specifying the DO NOTHING clause in a MERGE statement. This specification will be backported to PostgreSQL 15 and later. [4989ce7]
PDF page 12
2.6.4 Explain statement
The output format of subqueries with the EXPLAIN statement has been changed. [fd0398f]
PDF page 13
2.6.5 Pgrowlocks function
The output of the modes column of the results of executing the pgrowlocks function in the pgrowlocks extension has been changed. This change will be backported to the previous version. [15d5d74]
| version | version | Note |
|---|---|---|
| Share | For Share | |
| Key Share | For Key Share |
2.6.6 Other functions
There is an incompatibility with the pg_walfile_name / pg_walfile_name_offset functions. In previous versions, these functions returned the previous segment number when the LSN was on a segment boundary. It has been changed to always return the current segment number of the LSN. This fix is also reflected in previous versions. [344afc7]
PDF page 14
3 Architecture
PDF page 14
3.1.1 Modified System catalogs
The following catalogs and views have been changed. [1e68e43, 007693f, 46ebdfe, 78806a9, 13aeaf0, 3ee2f25, b0e96f3, e64c733 ,e83d1b0, 96f0526, bc3c8db, 12915a5, 4f62250, 46a0cd4, c393308, 776621a, ddd5f4f, 030e10f, f696c0c, 012460e, 6ae701b, a11f330, 6d49c8d, 7294396, 667e65a, 74604a3, 74604a3, f1affb6]
| View name | Description |
|---|---|
| pg_wait_events | The name and description of the waiting event will be output |
| pg_stat_checkpointer | The execution statistics of checkpointer process is output |
| View name | Add column | Data type | Description | |
|---|---|---|---|---|
| Catalog/View name | Add column | Data type | Description | |
| pg_database | dathasloginevt | boolean | Defined login event triggers | |
| pg_replication_slots | failover | boolean | Logical slot enabled to be synced to the standbys | |
| synced | boolean | Logical slot that was synced from a primary server | ||
| invalidation_reason | text | The reason for the slot’s invalidation | ||
| inactive_since | timestamp time zone | with | The time since the slot has become inactive | |
| pg_stat_progress_copy | tuples_skipped | bigint | Number of tuples skipped | |
| pg_stat_progress_vacuum | indexes_total | bigint | Total number of indexes that will be vacuumed | |
| indexes_processed | bigint | Number of indexes processed | ||
| dead_tuple_bytes | bigint | Amount of dead tuple data | ||
| Catalog/View name | Add column | Data type | Description | |
| max_dead_tuple_bytes | bigint | Amount of dead tuple data based on maintenance_work_mem | ||
| num_dead_item_ids | bigint | Number of dead item identifiers collected | ||
| pg_stat_subscription | worker_type | text | Type of the subscription worker process | |
| pg_stats | range_length_histogram | anyarray | A histogram of the lengths of non-empty values | |
| range_empty_frac | real | Fraction of column entries whose values are empty ranges | ||
| range_bounds_histogram | anyarray | A histogram of lower and upper bounds of non-empty values | ||
| pg_subscription | subfailover | boolean | The associated replication slots are enabled to be synchronized to the standbys |
PDF page 15
| View name | Remove column | Description |
|---|---|---|
| pg_stat_bgwriter | buffers_backend | It duplicates the pg_stat_io view. |
| buffers_backend_fsync | It duplicates the pg_stat_io view. | |
| checkpoints_timed | Move to pg_stat_checkpointer | |
| checkpoint_req | Move to pg_stat_checkpointer | |
| checkpoint write time__ | Move to pg_stat_checkpointer | |
| checkpoint sync time__ | Move to pg_stat_checkpointer | |
| buffers_checkpoint | Move to pg_stat_checkpointer | |
| pg_stat_progress_vac | num_dead_tuples | Renamed to dead_tuple_bytes |
| uum | max_dead_tuples | Renamed to max_dead_tuple_bytes |
| View name | Before | After | Note |
|---|---|---|---|
| pg_database | daticulocale | Datlocale | |
| pg_collation | coliculocale | Collocate |
PDF page 16
| View name | Removed column | Description |
|---|---|---|
| element_types | domain_default | Due to defects in standard specifications |
| View name | Description |
|---|---|
| pg_attribute | The NOT NULL constraint on the attstattarget column was removed, and the value indicating the default statistics was changed from -1 to NULL. |
| pg_backend_memory_contexts | The “search_path processing cache” is now output. |
| pg_statistic_ext | The data type of the stxstattarget column was changed from integer to smallint. stxstattarget column NOT NULL constraints were removed. |
| pg_stat_wal | WAL information output by the bgwriter process is added. This change is backported to PostgreSQL 14 or later. |
Pg_wait_events view
The following is the detailed description of the pg_wait_events view added to PostgreSQL 17. The pg_wait_events view provides the names and descriptions of registered wait events. [1e68e43]
| Column name | Data type | Description | Note |
|---|---|---|---|
| type | text | Type of Wait Event | Activity, Lock, IO, etc. |
| name | text | Name of Wait Event | |
| description | text | Wait Event description |
PDF page 17
Pg_stat_checkpointer view
The following is the detail of the pg_stat_checkpointer view, which is new to PostgreSQL 17. [96f0526, 12915a5]
| Column name | Data type | Description | |
|---|---|---|---|
| num_timed | bigint | Number of scheduled checkpoints | |
| num_requested | bigint | Number of checkpoints requested | |
| restartpoints_timed | bigint | Number of restart points timed out or rescheduled | |
| restartpoints_req | bigint | Number of restart points requested | |
| restartpoints_donewrite_time | bigint | Number of restart points executed | |
| double precision | double precision | Total write time | |
| sync_timebuffers_writtenstats_reset | double precision bigint | double precision | Total synchronization time Number of buffers written |
| timestamp time zone | with | Reset timestamps |
PDF page 18
3.1.2 Logical Replication Enhancements
The following features have been added to Logical Replication.
Integration with Streaming Replication
The WAL Sender (walsender) process of logical replication can be configured to send any update data to the plugin after confirming that the replication slot in streaming replication has received the WAL. The primary server parameter synchronized_standby_slots specifies the name of the streaming replication slot that should confirm the transfer. To use this feature, the ‘failover’ attribute of the logical replication slot must be set as described below. If the replication slot specified in synchronized_standby_slots becomes inactive Logical replication transfers are also stopped and the following message is periodically output to the primary server log. [bf279dd]
Replication slot new attribute
The parameter ‘failover’ has been added to the pg_create_logical_replication_slot function. The default value of this parameter is ‘false’. Replication slots with this parameter set to ’true’ can synchronize LSN information to the standby instance of streaming replication. The ‘failover’ column has been added to the pg_replication_slots catalog to store the added attribute values. [c393308]
PDF page 19
Subscription new attribute
The new attribute FAILOVER can now be specified for subscriptions. To store this attribute, a subfailover column has been added to the pg_subscription catalog. If this attribute is set to TRUE for the subscription, replication slots created on the primary server will also have the FAILOVER attribute at the same time.
PDF page 20
Logical Replication Slot Synchronization
The information of logical replication slots created on the primary server can be periodically synchronized to the standby server in streaming replication. [93db6cb] The following conditions are required on the streaming replication standby server to use this feature.
Set the parameter sync_replication_slots to ‘on’ (default ‘off’)
Set the parameter wal_level to ’logical’ (default ‘replica’)
Use the replication slot with the ‘failover’ option specified
Setting of the parameter primary_slot_name
Parameter hot_standby_feedback set to ‘on’ (default ‘off’)
Include ‘dbname’ setting in parameter primary_conninfo If the above conditions are met, the “slotsync worker” process is launched on the streaming replication instance. If the conditions are not met, the following log is output.
Pg_sync_replication_slots function
PostgreSQL 17 adds the function pg_sync_replication_slots to synchronize logical replication slots on streaming replication standby servers. This function forces synchronization of replication slot information even in environments where the parameter sync_replication_slots is set to ‘off’. [ddd5f4f]
PDF page 21
Use hash the index on subscribers
The subscribers can now use not only Btree indexes but also Hash indexes for update processing. [edca342]
Pg_logical_emit_message function
Added parameter ‘flush’ to control WAL flush. The default value is ‘false’, which means no messages will be flushed. [173b56f]
Syntax 1 - Pg_logical_emit_message function
3.1.3 Streaming Replication Enhancements
Data to be transferred to the standby instance is now retrieved from the WAL buffer if possible. Previously, the data was reloaded from the WAL file after the writing was completed. [91f2cae]
3.1.4 Incremental Backup
The incremental backups are now available as a standard feature of PostgreSQL. [174c480, dc21234, ee1bfd1, d9ef650, f8ce4ed]
WAL summary
To use incremental backup, the WAL summarize feature must be enabled. The WAL summarize feature can be enabled by setting the parameter wal_level to ‘replica’ or ’logical’ and changing the parameter summarize_wal (default value ‘off’) to ‘on’. When this feature is enabled, a “walsummarizer” process is invoked in the instance and summary data of the WAL file is stored in the ${PGDATA}/pg_wal/summaries directory.
PDF page 22
| Function name | Description |
|---|---|
| pg_available_wal_summaries | Returns the starting LSN and ending LSN for each WAL summary file |
| pg_wal_summary_contents | Return update information between specified LSNs |
| pg_get_wal_summarizer_state | Returns status of WAL summary creation |
Syntax 2 - WAL summary retrieval functions
PDF page 23
Incremental Backup
The incremental backup is a feature that retrieves the difference the previous backup. The manifest file output during the previous backup is used to obtain an incremental backup. To execute the incremental backup, specify the manifest file of the previous backup in the –incremental option (abbreviated form -i) of the pg_basebackup command.
PDF page 24
Manifest file enhancements
The System Identifier is now output in the manifest file. The version of the manifest file has been changed to version 2. [2041bc4]
PDF page 25
3.1.5 Partition Table Enhancements
The following new features have been implemented for partition tables.
Enhancements to Partition Pruning
The IS UNKNOWN, IS NOT UNKNOWN clause for boolean columns now supports partition pruning. [07c36c1]
Allow exclude constraints
Previously, only unique constraints using Btree were allowed for partitions. PostgreSQL 17 now also allows EXCLUDE CONSTRAINT with the same restrictions. However, column comparisons must be performed for equality. In the second example below, an error occurs because the partition key does not include the constraint target column. [8c852ba]
PDF page 26
Support for IDENTITY column
The INSERT statements are now supported on partitions of partitioned tables with IDENTITY columns. The second INSERT statement in the example below will cause an error in PostgreSQL 16. [6995863]
PDF page 27
3.1.6 Roles and Privileges
Predefined roles and privileges that can be granted have been added.
MAINTAIN privilege
The MAINTAIN privilege can now be granted on tables and materialized views. A role granted this privilege can execute VACUUM, ANALYZE, REINDEX, REFRESH MATERIALIZED VIEW, CLUSTER, and LOCK TABLE statements on the target relation. The result of the \dp meta-command in the psql command will output ’m’. [ecb0fd3]
PDF page 28
Addition of pg_maintain role
The pg_maintain predefined role has been added. This role is able to grant MAINTAIN privilege on all relations.
Modification of pg_monitor role
The predefined role pg_monitor has been granted permission to execute the pg_current_logfile function. [8d8afd4]
3.1.7 Built-in Locale Provider
PostgreSQL 17 has added a ‘built-in’ locale provider that is independent of external environments such as Libc or icu. The BUILTIN can now be specified in commands and SQL statements that specify a locale provider. [2d819a0, f69319f]
PDF page 29
3.1.8 Event Trigger
The following features have been added to event triggers.
Disabling Event Triggers
default value is ‘on’, which enables event triggers.
Login event trigger
The login event trigger, which is executed on successful authentication from the client, has been added. The following is an example of the event trigger that appends the connection time to the table. [e83d1b0]
PDF page 30
Reindex DDL trigger
The DDL event triggers can now be generated at the start and end of the execution of REINDEX statements. [f21848d]
PDF page 31
PDF page 32
3.1.9 Configuration File
The maximum length of tokens in the pg_hba.conf and pg_ident.conf files has been extended from 256 bytes to unlimited. In complex environments configured with LDAP, there were problems with exceeding the previous maximum length. [38df84c]
3.1.10 Log files
The following new changes have been implemented in the output of the server logs.
Logging of trust connections
When the parameter log_connections is set to “on”, logs are output for trust connections as follows. [38df84c]
PDF page 33
Replication Slot logging
The logs about replication slots are output at the LOG level (usually at the DEBUG1 level) when the parameter log_replication_commands is set to ‘on’. The following example shows the logs at the beginning and end of replication. [7c3fb50]
Recovery related logging
The logs at the start and end of the recovery process have been added. The following example shows the log at instance startup for streaming replication. [1d35f70]
PDF page 34
3.1.11 Hook
The following Object Access Type (OAT) hooks have been added to the ALTER TABLE statement. [352ea3a]
{ ENABLE | DISABLE | [NO] FORCE } ROW LEVEL SECURITY
{ ENABLE | DISABLE } TRIGGER
{ ENABLE | DISABLE } RULE
3.1.12 Libpq
The following APIs have been added and enhanced.
Connect string sslnegotiation
The connection option sslnegotiation has been added. This option determines how the encryption method is negotiated during the client connection. This option can also be specified by the environment variable PGSSLNEGOTIATION. [d39a49c, fb5718f]
| Value | Description | Note |
|---|---|---|
| postgres | Perform PostgreSQL protocol negotiation. | Default |
| direct | First attempt to establish a standard SSL connection and if that fails reconnect and perform the negotiation. | |
| requiredirect | Attempt to establish a standard SSL connection and if that fails return a connection failure immediately. |
Close Portals and Statements
Functions to close portals and statements have been added. Functions with “send” in the name are non-blocking versions. [28b5726]
| Function | Description |
|---|---|
| PQclosePrepared | Close the prepaid statement. |
| PQclosePortal | Close the portal. |
| PQsendClosePrepared | Close the Prepared statement. Do not wait for completion. |
| PQsendClosePortal | Closes the portal. Do not wait for completion. |
PDF page 35
Password change
The function PQchangePassword has been added to change the password of a connected user. [a7be2a6]
Changes to chunk mode
The PGresults now retrieves multiple tuples at once. The function PQsetChunkedRowsMode has been added to change the mode accordingly. [4643a2b]
Pipeline Synchronization
The PQsendPipelineSync function has been added. This function is similar to the PQpipelineSync function, but it does not flush a synchronization message to the server unless the output buffer reaches a threshold value. [4794c2]
Sequence operation
The functions have been added to manipulate sequences, such as the relation_open function. [449e798]
| Function | Description | Note |
|---|---|---|
| sequence_opensequence_close | Open the sequence Close the sequence |
Injection Points
The following functions have been added to support injection points. [d86d20f]
| Function | Description | Note |
|---|---|---|
| InjectionPointAttach | Attaching Callbacks | |
| InjectionPointDetach | Detaching a callback | |
| InjectionPointRun | Run the injection point |
Non-Blocking cancel functions
Previously, the PQcancel API used blocking requests. It is now possible to send a cancel request without blocking. [61461a3]
PDF page 36
| Function | Description |
|---|---|
| PQcancelCreate | Prepare to send a cancel request. |
| PQcancelBlocking | Requesting discard of the current command in blocking state. |
| PQcancelPoll | Request discard of current command in non-blocking state. |
| PQcancelStart | Request discard of current command in non-blocking state. |
| PQcancelStatus | Retrieve the status of a canceled connection. |
| PQcancelSocket | Retrieve the identifier of the canceled connection socket. |
| PQcancelErrorMessage | Get the last error generated by the cancel operation. |
| PQcancelFinish | Close the connection. |
| PQcancelReset | Reset PGcancelConn and reuse it for a new connection. |
Background Worker
The flag BGWORKER_BYPASS_ROLELOGINCHECK can now be specified in the functions BackgroundWorkerInitializeConnection and BackgroundWorkerInitializeConnectionBy-Oid. This flag allows bypassing the role login check. [e768919]
DSM Registry
The function GetNamedDSMSegment has been added to allow shared libraries to easily use shared memory. Previously, shared libraries specified in the parameter shared_preload_libraries had to request shared memory via the shmem_request_hook hook. [8b2bcf3]
DSA Initial Size
Previously, DSAs were created at 1 MB and the maximum is still extended to DSA_MAX_SEGMENT_SIZE. The dsa_create_ext and dsa_create_in_place_ext functions have been added to allow the initial and maximum sizes to be specified. [bb952c8]
Streaming I/O
Abstracts access to relations and allows relation data to be accessed as a stream of buffers. This modification will make it easier to make changes in the future when implementations such as asynchronous I/O are added. It is used to execute the ANALYZE statement and perform a sequential scans on the table. [b7b0f3f, 041b968, b5a9b18]
PDF page 37
| Function | Description | Note |
|---|---|---|
| read_stream_begin_relation | Create a new read streaming object. | |
| read_stream_next_buffer | Retrieve a single fixed buffer from the stream. | |
| read_stream_resetread_stream_end | Release the queued buffer and reset the stream. Release the stream. |
Multi-block read
The multi-block version of the ReadBuffer API is now provided. The maximum number of blocks is determined by the new parameter io_combine_limit. In the future, asynchronous I/O may be used internally. [210622c]
| Function | Description | Note |
|---|---|---|
| StartReadBufferStartReadBuffersWaitReadBuffers | Start reading a single block. Start reading multi blocks. Wait for the completion of block read. |
Bump Memory Allocation
The memory allocator BumpContext has been added, which is suitable for memory allocations with short life times. BumpContext memory is now used for sorting tuples and for VACUUM processing. [29f6a95, 6ed83d5, 8a1b31e]
PDF page 38
| Function | Description |
|---|---|
| BumpContextCreate | Create Bump MemoryContext. |
| BumpAlloc | Allocate Bump memory. |
| BumpFree | Free Bump memory. |
| BumpRealloc | Re-allocate Bump memory. |
| BumpReset | Frees all memory which is allocated in the given set. |
| BumpDelete | Frees all memory which is allocated in the given context. |
| BumpGetChunkContext | Un-supported. |
| BumpGetChunkSpace | Un-supported. |
| BumpIsEmpty | Returns true if ‘block’ contains no chunk. |
| BumpStats | Compute stats about memory consumption of the context. |
| BumpCheck | Walk through chunks and check consistency of memory. |
Polling file descriptor
The PQsocketPoll function has been provided to monitor file descriptors. [f5e4ded]
3.1.13 Access Method
The following enhancements have been added to the access methods.
Parallel build of BRIN index
The multiple worker processes can now be used to build BRIN indexes. The amcanbuildparallel flag has been added to the index access method structure IndexAmRoutine. [b437571]
heap_page_prune function
The parameters of the HEAP_PAGE_PRUNE function have been changed to allow multiple options to be specified in a bitmap. Currently, only HEAP_PAGE_PRUNE_MARK_UNUSED_NOW and HEAP_PAGE_PRUNE_FREEZE options are available. [3d0f730, 6dbb490]
3.1.14 Wait Events
The following features have been added for wait events.
PDF page 39
Modified Wait Events
The following wait events have been added or changed. [fa88928, c9af054, c8e318b, 0013ba2, 5c430f9, d86d20f]
| Wait Event Name | Class | Description |
|---|---|---|
| CheckpointDelayComplete | IPC | Waiting for the backend to complete checkpoint |
| CheckpointDelayStart | IPC | Waiting for backend to start checkpoint |
| MultixactCreation | IPC | Waiting for multi-transaction creation |
| ReplicationSlotsyncMain | Activity | Replication slot synchronization wait |
| ReplicationSlotsyncShutdown | Activity | Waiting for replication slot to stop |
| WaitForStandbyConfirmation | Client | Waiting for standby confirmation |
| WalSummarizerError | Timeout | WAL summary error |
| WalSummaryRead | IO | Waiting for WAL summary to load |
| WalSummaryReady | IPC | Waiting for WAL summary generation |
| WalSummaryWrite | IO | Waiting for WAL summary writing |
| InjectionPoint | LWLock | Waiting for injection point loading |
| change | change | Note |
|---|---|---|
| AutoVacuumMainBaseBackupReadBaseBackupSyncBaseBackupWriteBgWorkerShutdownBgWorkerStartup | AutovacuumMain BasebackupRead BasebackupSync BasebackupWrite BgworkerShutdown BgworkerStartup | |
| BgWriterHibernateBgWriterMainBufferIOBufFileReadBufFileTruncateBufFileWriteDSMAllocateDSMFillZeroWriteGSSOpenServer | BgwriterHibernate BgwriterMain BufferIo BuffileRead BuffileTruncate BuffileWrite DsmAllocate DsmFillZeroWrite GssOpenServer | |
| LibPQWalReceiverConnect | LibpqwalreceiverConnect | |
| LibPQWalReceiverReceive | LibpqwalreceiverReceive | |
| LockFileAddToDataDirRead | LockFileAddtodatadirRead | |
| LockFileAddToDataDirSync | LockFileAddtodatadirSync | |
| LockFileAddToDataDirWrite | LockFileAddtodatadirWrite | |
| LockFileReCheckDataDirRead | LockFileRecheckdatadirRead | |
| ProcArrayGroupUpdateSLRUFlushSyncSLRUReadSLRUSyncSLRUWriteSSLOpenServerSysLoggerMainWALBootstrapSync | ProcarrayGroupUpdate SlruFlushSync SlruRead SlruSync SlruWrite SslOpenServer SysloggerMain WalBootstrapSync | |
| WALBootstrapWriteWALCopyReadWALCopySyncWALCopyWriteWALInitSyncWALInitWriteWALRead | WalBootstrapWrite WalCopyRead WalCopySync WalCopyWrite WalInitSync WalInitWrite WalRead | |
| WALSenderTimelineHistoryRead | WalsenderTimelineHistoryRead | |
| WalSenderWaitForWALWALSync | WalSenderWaitForWal WalSync | |
| WALSyncMethodAssignWALWrite | WalSyncMethodAssign WalWrite |
PDF page 40
List of Wait Events
The list of wait events is now written in the file src/backend/utils/activity/wait_event_names.txt and the code and documentation are generated automatically. [59cbf60]
PDF page 41
Custom Type
The method of registering custom wait events has been changed. New API “uint32 WaitEventExtensionNew(const char *wait_event_name)” is provided. With this, the shared memory hook is no longer required. [af720b4]
3.1.15 FILLFACTOR
The FILLFACTOR is now considered in the estimated number of tuples when table statistics are not gathered. Previously, FILLFACTOR was not considered, which could result in an overestimation of the number of tuples. [29cf61a]
PDF page 42
3.1.16 VACUUM
The TidStore is now used to store tuple IDs for VACUUM instead of a simple array. This change reduces the amount of memory used, which used to be larger, and eliminates the 1 GB limit. In addition, some column names in the pg_stat_progress_vacuum view have been changed. [667e65a]
3.1.17 LLVM
PostgreSQL 17 now supports LLVM 17, 18. Backported to supported older versions of PostgreSQL. [76200e5, d282e88]
3.1.18 Acceleration
The CRC calculation function COMP_CRC32C can now be executed natively in environments that support LoongArch. [4d14ccd] In environments where the Intel AVX-512 instruction set can be used, visibilitymap_count and pg_popcount functions can now be executed faster. [41c51f0, 792752a]
3.1.19 UNICODE
PostgreSQL 17 has the following changes in Unicode support. [9d17e5f, 9e2e4f0, ad49994]
- Unicode version changed from 15.0.0 to 15.1.0 (https://unicode.org/versions/Unicode15.1.0/)
PDF page 43
Unicode CLDR version changed from 43 to 45 (https://cldr.unicode.org/index/downloads/cldr-45)
Add update-unicode build target to update UNICODE table
4 SQL Statements
PDF page 44
This section explains new features related to SQL statements.
3.2.1 ALTER OPERATOR
The following attributes can now be altered by the ALTER OPEARTOR statement. Previously, these could only be specified in the CREATE OPERATOR statement. However, once a flag is set, it cannot be changed. [2b5154b]
COMMUTATOR
NEGATOR
HASHES
MERGES
3.2.2 ALTER SYSTEM
A parameter containing module names (e.g., foo.bar) used by extensions, etc., can now be specified in the ALTER SYSTEM statement. In the previous version, only parameters for which a SET statement had been executed in the past could be set with the ALTER SYSTEM statement. [2d870b4]
PDF page 45
3.2.3 ALTER TABLE
The following enhancements have been implemented to the ALTER TABLE statement.
Change to default access method
To change to the access method specified in the parameter default_table_access_method, it is now possible to specify DEFAULT for the access method name. [d61a6ca]
Syntax 3 - ALTER TABLE SET ACCESS METHOD statement
Change Generate Column
The formulas for generated columns (GENERATE clause) can now be changed. If the formula for the column is changed, the existing data in the table will be recalculated. [5d06e99]
PDF page 46
Syntax 4 - ALTER TABLE SET EXPRESSION statement
Statistics Settings
It is now possible to use DEFAULT when setting the volume of statistics stored in a single column to the parameter default_statistics_target. In previous versions, -1 was specified. When using the default value, the attstattarget column in the pg_attribute catalog will be set to the NULL value. Previously, the NOT NULL constraint was specified for this column. [4f62250, 5567996]
Syntax 5 - ALTER TABLE SET STATISTICS statement
PDF page 47
3.2.4 CLUSTER
The syntax for enclosing options in parentheses (()) is now permitted when the table name is omitted. This enhancement supports the same syntax as the REINDEX and VACUUM statements. [cdaedfc]
3.2.5 COPY
The following new features have been implemented in the COPY statement.
PDF page 48
FORCE_NULL option
An asterisk (*) can now be specified in the FORCE_NULL and FORCE_NOT_NULL options of the COPY statement. [f6d4c9c]
ON_ERROR option
The ON_ERROR option has been added to the COPY FROM statement. This option changes the behavior when an error occurs. The following values can be specified for this option. [9e2d870, b725b7e, a6d0fa5]
| Value | Description |
|---|---|
| stop | Stop processing when an error occurs. |
| ignore | Ignore the occurrence of data conversion errors and continue the processing. |
Even if this option is set to ‘ignore’, the COPY statement will terminate abnormally if a constraint violation (primary key constraint or CHECK constraint) occurs.
PDF page 49
LOG_VERBOSITY option
The LOG_VERBOSITY option has been added to the COPY statement to change the level of log output. The LOG_VERBOSITY option controls the output of errors generated by a COPY FROM statement with the ON_ERROR option set to ‘ignore’. The possible values are as follows. [f5a2278]
| Value | Description | Note |
|---|---|---|
| default | Output standard log level. | Default |
| verbose | Output verbose log level. |
PDF page 50
3.2.6 CREATE TABLE
The access method can now be specified for the partitioned table, using the CREATE TABLE USING or ALTER TABLE SET ACCESS METHOD statements. The specified value will be used as the default value for the access method for the partitions created under the partitioned table. The existing partitions will not be modified. [374c7a2]
PDF page 51
Syntax 6 - CREATE TABLE PARTITION BY USING statement
3.2.7 EXPLAIN
The following new features have been added to the EXPLAIN statement.
Enhancements to JSON Format
Local I/O Read Time" and “Local I/O Write Time” are now output in JSON format. To enable this output, the parameter track_io_timing must be set to ‘on’. [295c36c]
PDF page 52
MEMORY option
The MEMORY option has been added to the EXPLAIN statement to output the memory settings when creating an execution plan. The EXPLAIN statement with the MEMORY clause outputs information about the amount of memory allocated (allocated) and the amount of memory actually used (used). [5de890e]
SERIALIZE option
The SERIALIZE clause has been added that outputs information on the amount of data and time output to the client by the query execution. This option is used in conjunction with the ANALYZE clause. The following values can be added to the option. [0628670]
| Value | Description | Note |
|---|---|---|
| none | Do not output serialization information | Default |
| textbinary | Output in text format Output in binary format | Default for SERIALIZE only |
PDF page 53
3.2.8 MERGE
The following new features have been added to the MERGE statement.
BY SOURCE clause
The condition specification ``WHEN NOT MATCHED BY SOURCE’’ has been added to the MERGE statement. This condition operates on tuples that do not exist in the source table but exist in the target table. The UPDATE, DELETE, and DO NOTHING clauses can be specified as the action for the target tuple. [0294df2]
PDF page 54
RETURNING clause
The MERGE statements can now specify the RETURNING clause to return the data of updated tuples, and a special function merge_action has been added to determine the type (INSERT/UPDATE/DELETE) of the tuple returned by the RETURNING clause. The output of the RETURNING clause is available as a source relation like any other DML. [c649fa2]
PDF page 55
MERGE statement for updatable views
The updatable views can now be specified as targets in the MERGE statement. [5f2e179]
PDF page 56
3.2.9 PL/pgSQL
The following enhancements have been implemented in PL/pgSQL.
Addition of data type attributes
The array declaration can now be specified for the %TYPE and %ROWTYPE attributes of variables. [5e8674d]
PDF page 57
INTERNAL Sub-Transaction
The BeginInternalSubTransaction API can now be run in parallel mode. In the example below, PostgreSQL 16 executes a PL/pgSQL function with PARALLEL SAFE specified in parallel mode, and an error occurs. [0075d78]
3.2.10 Data Types
The following enhancements have been implemented for PostgreSQL 17 data types.
INTERVAL
The +/-Infinity is now supported for the INTERVAL type. [519fc1b]
PDF page 58
AT LOCAL clause
The AT LOCAL clause can now be specified to convert timestamps with time zones to local time zones. [97957fd]
RANGE
The expressions containing constant range values can now be directly compared for the range operators ‘<@’ and ‘@>’. [075df6b]
PDF page 59
3.2.11 JSON
The JSON-related syntax has been enhanced.
JSON Constructor
The following JSON constructor functions have been added. [03734a7]
Syntax 7 - JSON constructor
PDF page 60
JSONPATH method
The following JSONPATH methods have been added. [66ea94e, 4697454]
| Method | Description | Note |
|---|---|---|
| .bigint() | Returns a large integer value | |
| .boolean() | Return True or False | |
| .date() | Returns a date | |
| .decimal([p [,s]]) | Returns a number with a specified precision | |
| .integer() | Returns an integer | |
| .number() | Returns a numeric value | |
| .string() | Returns a character string | |
| .time() | Returns a time | |
| .time_tz() | Returns the time with timezone | |
| .timestamp() | Returns a timestamp | |
| .timestamp_tz() | Returns a timestamp with timezone |
PDF page 61
PDF page 62
JSON Query
The functions have been added to query within JSON data. The JSON_EXISTS function returns true if the item was generated using the PASSING clause. The JSON_QUERY and JSON_VALUE functions return the result of applying the PASSING clause from the specified JSON data. [6185c97]
Syntax 8 - JSON Query
PDF page 63
Relational conversion
The JSON_TABLE function has been added to convert JSON data to the relational view. [de36004, bb766cd]
Syntax 9 - JSON_TABLE function
PDF page 64
Jsonb_populate_record_valid function
The jsonb_populate_record_valid function has been added. This function returns true if the jsonb_populate_record function does not generate an error for the specified JSON object, or false if it does. [1edb3b4]
Syntax 10 - Jsonb_populate_record_valid function
PDF page 65
3.2.12 Functions
The following functions have been added/enhanced.
Pg_promote
The error message is now output if sending a signal to the postmaster process fails. [f593c55]
Syntax 11 - Error messages that may be output
Pg_basetype
The function pg_basetype has been added. This function returns the base type for a given domain. [b154d8a]
Syntax 12 - Pg_basetype function
PDF page 66
Random
The functions have been added to generate random numbers that have “minimum value ≤ random ≤ maximum value” given a minimum and maximum value. [e634132]
Syntax 13 - Random function
To_bin / to_oct
The function to convert a number to a binary string or octal string has been added. [260a1f1]
Syntax 14 - To_bin / to_oct function
To_regtypemod
The to_regtypemod function has been added. This function retrieves the typemod information of a datatype from a datatype string. This information can be used with the format_type function, etc. [1218ca9]
PDF page 67
Syntax 15 - To_regtypemod function
To_timestamp
The to_timestamp function can now specify TZ and OF in the format string. In previous versions, it was only available in the to_char function. [8ba6fdf]
UNICODE related
The basic functions related to UNICODE versions have been added. The unicode_version function outputs the UNICODE version used by the database cluster, and the icu_unicode_version function outputs the UNICODE version used by the ICU library. The unicode_assigned function verifies whether the specified string is assigned to UNICODE. [a02b37f]
PDF page 68
Syntax 16 - UNICODE related functions
XMLText
The XMLText function of the XML standard (SQL/XML X038) has been added. This function converts text information into XML text nodes. The –with-libxml option is required at PostgreSQL build time to execute this function. [526fe0d]
Syntax 17 - XMLText function
PDF page 69
Uuid_extract_version / uuid_extract_timestamp
The functions to extract version numbers and timestamps from UUIDs have been added. [794f10f]
Syntax 18 - UUID related functions
Pg_column_toast_chunk_id
The newly added pg_column_toast_chunk_id function returns the chunk ID of TOAST data. [d1162cf]
Syntax 19 - Pg_column_toast_chunk_id functions
PDF page 70
Pg_stat_reset_shared
The behavior of the pg_stat_reset_shared function has changed. If the parameter to the pg_stat_reset_shared function is omitted or specified as NULL, all statistics counters are reset. Also, the pg_stat_reset_shared function parameter can now contain the string ‘slru’ to reset the pg_stat_slru view. [23c8c0c, 2e8a0ed]
Syntax 20 - Pg_stat_reset_shared functions
Pg_stat_reset_slru
If the parameter of the pg_stat_reset_slru function is omitted, all SLRU statistics counters are reset. [e5cca62]
Syntax 21 - Pg_stat_reset_slru functions
The element name specified as a parameter to this function has been changed. Entering a string other than the changed name will reset the “other” item. [bcdfa5f]
PDF page 71
| changed Name | changed Name | Note |
|---|---|---|
| CommitTs | commit_timestamp | |
| MultiXactMemberMultiXactOffsetNotifySerialSubtransXact | multixact_membermultixact_offsetnotifyserializablesubtransactiontransaction |
3.2.13 Optimizer
Faster execution plans are now chosen in the following cases.
GROUP BY optimization
If the GROUP BY clause with multiple columns is not related to the sort order, the sorting process can now be reduced by swapping the columns. This behavior is enabled by setting the parameter enable_group_by_reordering to ‘on’ (default ‘on’). [0452b46]
PDF page 72
UNION optimization
The Merge Append plan can now be used for lookups that contain a UNION clause in the subquery. Previously, Sort plan was required. [66c0185]
PDF page 73
Better IS [NOT] NULL Handling
The optimizations have been implemented to reduce unnecessary evaluation of IS NULL and IS NOT NULL clauses. [b262ad4]
PDF page 74
Better Parallel DISTINCT Processing
The Gather Merge plan is now available for parallel execution of SELECT statements with DISTINCT clauses. [7e0ade0]
PDF page 75
GiST Index optimization
The Incremental Sort plan is now available for GiST and SP-GiST indexes. [625d5b3]
PDF page 76
5 Configuration Parameters
PDF page 77
In PostgreSQL 17, the following parameters have been changed.
3.3.1 Added parameters
The following parameters have been added. [7750fef, a14354c ,2cdf131, 174c480, 0452b46, 51efe38, 53c2a97, bf279dd, d3ae2a2, 210622c, 705843d]
| Parameter name | Description (context) | Default value |
|---|---|---|
| allow_alter_system | Allow execution of ALTER SYSTEM statement (sighup) | on |
| commit_timestamp_buffers | Commit timestamp cache size (postmaster) | 0 (auto) |
| enable_group_by_reordering | GROUP BY replacement optimization (user) | on |
| event_triggers | Enable event triggers (superuser) | on |
| huge_pages_status | Indicate whether Huge Pages are being used (internal) | - |
| io_combine_limit | Maximum number of Raad/Write blocks (user) | 128kB |
| max_notify_queue_pages | Maximum number of pages allocated to NOTIFY/LISTEN queue (postmaster) | 1048576 |
| multixact_member_buffers | Member cache size for multi-transaction (postmaster) | 32 |
| multixact_offset_buffers | Multi-transaction offset cache size (postmaster) | 16 |
| notify_buffers | LISTEN/NOTIFY message cache size (postmaster) | 16 |
| restrict_nonsystem_relation_kind | The type of non-system relation to restrict use (user) | |
| serializable_buffers | Serializable transaction cache size (postmaster) | 32 |
| synchronized_standby_slots | Replication slot name for standby database (sighup) | '' |
| subtransaction_buffers | Size of sub-transaction cache (postmaster) | 0 (auto) |
| summarize_wal | Output WAL summary (sighup) | off |
| sync_replication_slots | Whether replication slots are synchronized (sighup) | off |
| trace_connection_negotiation | Obtain SSL negotiation trace (postmaster) | off |
| transaction_buffers | Transaction status cache size (postmaster) | 0 (auto) |
| transaction_timeout | Transaction execution timeout (user) | 0 |
| wal_summary_keep_time | WAL summary retention duration (sighup) | 10d |
PDF page 78
The restrict_nonsystem_relation_kind will be backported to older versions of PostgreSQL that are supported from PostgreSQL 12 onwards.
Allow_alter_system
This parameter determines whether the ALTER SYSTEM statement is allowed to be executed. The default value is ‘on’, which allows the ALTER SYSTEM statement to be executed. This parameter itself cannot be changed by the ALTER SYSTEM statement.
PDF page 79
Huge_pages_status
If the parameter huge_pages has the default value (try), no log output will be generated even if the acquisition of Huge Pages fails. The parameter huge_pages_status can be checked to see if the cluster is using Huge Pages.
| Value | Description | Note |
|---|---|---|
| on | Using Huge Pages | |
| off | Not using Huge Pages | |
| unknown Unknown | unknown Unknown | Only shown in special cases |
Transaction_timeout
Specify the maximum transaction execution time in milliseconds. If a timeout occurs, the session is forcibly disconnected. The default value is 0, which means no timeout will occur.
PDF page 80
3.3.2 Modified Parameters
The following parameters have been changed in terms of setting range and choices. [d0c2860, e48b19c, 7c3fb50]
| Parameter name | Changes |
|---|---|
| wal_sync_method | The configuration value fsync_writethrough is no longer available in Microsoft Windows environments. |
| log_connections | Information on trust connections is now output. |
| log_replication_commands | Replication slot addition information is now output. |
| maintenance_work_mem | The minimum has been changed from 1MB to 64kB. |
3.3.3 Parameters with default values changed
The following parameters have changed default values. [98f320e]
| Parameter name | PostgreSQL 15 | PostgreSQL 16 | Note |
|---|---|---|---|
| server_version | 16.4 | 17.0 | |
| server_version_num | 160004 | 170000 | |
| vacuum_buffer_usage_limit 256kB | vacuum_buffer_usage_limit 256kB | 2MB |
PDF page 81
3.3.4 Removed parameters
The following parameters have been removed. [884eee5, f691f5b, c7a3e6b]
| db_user_namespace | It was removed because it was determined that there were few users. |
|---|---|
| old_snapshot_threshold | Removed due to accuracy and performance issues. It is a desirable feature, and improved implementations may be available in the future. |
| trace_recovery_messages | Removed because it can be replaced by pg_waldump command, etc. |
Parameter name Reason
6 Utilities
PDF page 82
Describes the major enhancements of utility commands.
3.4.1 Clusterdb
The –all and other options can now be used at the same time. [1b49d56]
3.4.2 Configure
The following features have been implemented in the configure command.
Output version
The LLVM and OpenSSL versions are now output when executing the configure command. [5e4dacb, 55a428a]
Injection Points
The Injection points are features that allow developers to execute custom code, assist in testing for complex conflicts, etc. To use this feature, it is necessary to specify –enable-injection-points when executing the configure command. [d86d20f]
PDF page 83
3.4.3 Initdb
The following enhancements have been implemented to the initdb command. [2d819a0, f69319f]
–locale-provider option
The “builtin” can now be specified as the locale provider.
–builtin-locale option
Added –builtin-locale option to specify the locale for built-in locale providers.
3.4.4 Pg_archivecleanup
The following new features have been added to the pg_archivecleanup command. [dd7c60f, 3f8c98d]
Long name options
The long name options have been added to the single-character options.
| -n | –dry-run | Outputs the name of the file to be deleted to standard |
|---|---|---|
| -x | –strip-extension=EXT | Specify extensions to exclude from file names. |
Short option Long option Description -d –debug Outputs debug logs to standard error.
PDF page 84
Remove history files
The –clean-backup-history option ( shortened option -b) has been added to remove the history files.
3.4.5 Pg_combinebackup
The new command pg_combinebackup has been added. This command merges base and incremental backups. [dc21234, a9577ba]
| Option name | Short option | Description |
|---|---|---|
| –debug | -d | Output debug information |
| –dry-run | -n | Run test only |
| –no-sync | -N | Don’t wait for storage sync |
| –output | -o | Output directory |
| –tablespace-mapping=OLD=NEW | -T | Tablespace mapping |
| –manifest-checksums=METHOD | - | Manifest checksum specification |
| –no-manifest | - | Don’t use manifest |
| –sync-method=METHOD | - | Specifying the storage synchronization method |
| –clone | - | Using the clone system call |
| –copy | - | Perform regular file copy (default) |
| –copy-file-range | - | Using the copy_file_range system call |
| –help | -? | Output usage information |
| –version | -V | Output version information |
PDF page 85
3.4.6 Pg_createsubscriber
The new command pg_createsubscriber has been added. This command converts a streaming replication standby server to a logical replication standby server. The major advantage of using this command is to reduce the initial data copy overhead that occurs when setting up a logical replication environment. [d44032d, c671e14]
| –database= DBNAME | -d | Database name for which to create |
|---|---|---|
| –pgdata=DATADIR | -D | Database cluster for streaming replication to be converted |
| –dry-run | -n | Conversion test |
| –subscriber-port=PORT | -p | Port number of the subscriber |
| –publisher-server=CONN | -P | Connection string to publisher |
| –socketdir=DIR | -s | Socket directory to use |
| –recovery-timeout=SECS | -t | Seconds to wait for recovery to end |
| –subscriber-username=USER | -U | SUBSCRIPTION owner |
| –publication=NAME | - | Name of the PUBLICATION |
| –replication-slot=NAME | - | Replication slot name |
| –subscription=NAME | - | SUBSCRIPTION name |
| –verbose | -v | |
| –config-file=FILE | - | Configuration file’s path |
| –version | -V | Output version information |
| –help | -? | Output usage information |
Option name Short option Description
PDF page 86
The following requirements are necessary to execute the pg_createsubscriber command.
The primary server parameter wal_level must be set to ’logical'.
The standby instance must be shut down. When the pg_createsubscriber command is executed, PUBLICATION and logical replication slots are created on the primary server with all tables in the specified database (FOR ALL TABLES). The standby server is no longer a standby for streaming replication and the SUBSCRIPTION is created. The default PUBLICATION and replication slot name created on the primary server and the SUBSCRIPTION name created on the standby server is “pg_createsubscriber_{DB OID}_{random integer}”.
3.4.7 Pg_basebackup
The following new features have been implemented in the pg_basebackup command.
–dbname option
If a database name is specified in the –dbname option (-d) at the same time as the –write-recoveryconf option (-R), the database name will be output to the primary_conninfo parameter setting specified in the postgresql.auto.conf file. [a145f42]
–help option
The default value of the –checkpoint option is now output in the help message. [cd02b35]
PDF page 87
–incremental option
The –incremental option ( shortened option -i) to perform incremental backups has been added. This option specifies the path to the manifest file on which the backup is based.
3.4.8 Pg_dump
The following options have been added to the pg_dump command.
–filter option
The –filter option has been added to the pg_dump / pg_dumpall / pg_restore commands. This option specifies the file that describes the list of objects to be included (or excluded) from the dump file. The format of the file is as follows. [a5cf808]
Syntax 22 - Filter file format
| Object type name | Object | Equivalent command options |
|---|---|---|
| extension | Extension | –extension |
| foreign_data | Foreign Table | –include-foreign-data |
| table | Table | –table |
| table_and_children | Table and Child Table | –table-and-children |
| table_data | Table data only | –exclude-table-data |
| table_data_and_children | Table and Child Table data | –exclude-table-data-and-children |
| schema | Schema | –schema |
PDF page 88
–exclude-extension option
The –exclude-extension option has been added to exclude extensions with specified pattern names. [522ed12]
3.4.9 Pg_restore
The pg_restore command now has a –transaction-size option to perform a commit once the specified number of objects have been processed. The default behavior is to commit on a per-SQL basis. This option provides an intermediate behavior between per-SQL commit and single-transaction processing with the –single-transaction option. [959b38d]
3.4.10 Pg_resetwal
The order in which options are displayed in the –help option has been changed. [b5da1b3]
PDF page 89
3.4.11 Pg_upgrade
The following features have been implemented to the pg_upgrade command.
PDF page 90
Preserve subscriber state
The subscriber (SUBSCRIPTION) state can now be preserved. In previous versions, only metadata was preserved. [9a17be1]
Migrate logical replication slot
The logical replication slots are now recreated on the destination cluster during upgrade. [29d0a77]
–copy-file-range option
The option –copy-file-range has been added to copy files using the copy_file_range system call in Linux and FreeBSD environments. [d93627b]
3.4.12 Pg_walsummary
The command pg_walsummary has been added. This command parses the contents of the WAL summary file. [ee1bfd1]
| Option name | Short option | Description | Note |
|---|---|---|---|
| –indivisual | -i | Outputs detailed block information | |
| –quiet | -q | Perform parsing of files only | |
| –help | -? | Output usage | |
| –version | -V | Output version information |
3.4.13 Pgindent
The option name of the pgindent command has been changed. [387aecc]
PDF page 91
| Option Name | Option Name | Note |
|---|---|---|
| –show-diff | –diff | |
| –silent-diff | –check |
3.4.14 Psql
The following enhancements have been implemented to the psql command.
View of Aggregate Functions
The argument names have been added to the view of aggregate functions with multiple arguments. [b575a26]
\sf, \ef, \sv, \ev meta-command
The semicolons (;) at the end of lines are now ignored. In previous versions, an error occurred. [390298f]
PDF page 92
\watch meta-command
The min_rows (abbreviated m), which indicates the minimum number of output tuples, has been added to the watch meta-command. The iterative operation terminates when the specified number of tuples are no longer output. In the example below, the \watch command terminates because all tuples have been deleted from the data1 table. [f347ec7]
3.4.15 Reindexdb
The following features have been added to the reindexdb command.
Combining options
The –all and other options can now be used at the same time. [24c928a]
PDF page 93
Parallelization
The –jobs and –index options can now be used at the same time. Multiple indexes on different tables can be processed in parallel. [47f99a4]
3.4.16 Vacuumdb
The –all and other options can now be used at the same time. [648928c]
3.4.17 More than one command
The following commands now have an additional option “–sync-method” to determine the storage synchronization method for files. This option is disabled if the –no-sync option is specified. The utilities for which the –sync-method option has been added are as follows. [8c16ad3, cccc6cd]
initdb
pg_basebackup
pg_checksums
pg_dump
pg_rewind
pg_upgrade
| Value for option | Description | Note |
|---|---|---|
| fsync | Recursively synchronize file-by-file using the fsync system call. | Default |
| syncfs | Synchronize the entire file system using the syncfs system call. | Synchronize the entire file system using the syncfs system call. |
PDF page 94
7 Contrib Modules
PDF page 95
Describes new features related to the Contrib modules.
3.5.1 Amcheck
The bt_index_check function now has a checkunique parameter to check the integrity of unique constraints. The following example shows the error when corruption is found in the index data1_pkey for the primary key. [5ae2087]
3.5.2 Pg_buffercache
The following functions have been added to the pg_buffercache module. [13453ee]
| Function name | Description | Note |
|---|---|---|
| pg_buffercache_evict Remove any block from the buffer pool. | pg_buffercache_evict Remove any block from the buffer pool. | SUPERUSER only |
PDF page 96
3.5.3 Pg_stat_statements
The following features have been added to the pg_stat_statements module.
Enhancements of the pg_stat_statements view
The pg_stat_statements view has been modified with I/O-related columns and JIT-related and timestamp-related columns added. [13d0072, 5147ab1, dc9f8a7, 5a3423a]
| Column Name | Data Type | Description |
|---|---|---|
| local_blk_read_time | double precision | Local block read time |
| local_blk_write_time | double precision | Local block write time |
| shared_blk_read_time | double precision | Shared block read time |
| shared_blk_write_time double precision | shared_blk_write_time double precision | Shared block write time |
| jit_deform_count | bigint | JIT deform processing count |
| jit_deform_time | double precision | JIT deform processing time |
| stats_since | timestamp with time zone | Statement statistics collection time |
| minmax_stats_since | timestamp with time zone | Statement min/max statistics collection time |
| Column Name | Description |
|---|---|
| blk_read_time | Split into shared_blk_read_time and local_blk_read_time |
| blk_write_time | Split into shared_blk_write_time and local_blk_write_time |
Constants for Execution Statements
The SAVEPOINT, ROLLBACK TO, RELEASE, COMMIT PREPARED, PREPARE TRANSACTION, ROLLBACK PREPARED, DEALLOCATE, and overloaded CALL statements are saved in the pg_stat_statements table as constants with parameter symbols. Previously, statements with different specified names were saved separately. [31de7e6, 638d42a, bb45156, 11c34b3]
PDF page 97
PDF page 98
Pg_stat_statements_reset function
The parameter minmax_only has been added to the pg_stat_statements_reset function. Setting this parameter to true will reset the maximum/minimum value (min_plan_time column, min_exec_time column, etc.) information. [43cbeda]
PDF page 99
3.5.4 Postgres_fdw
The following features have been added to the postgres_fdw module.
Increase tuple cost
The default cost per tuple to access a remote table has been changed from 0.01 to 0.2. [cac169d]
De-parsing Semi-Join
The EXISTS clause used between tables in the same FOREIGN SERVER can now be executed remotely. [824dbea]
PDF page 100
PDF page 101
3.5.5 Ltree
The hash indexes are now accessible for match searches. [485f0aa]
3.5.6 Injection_points
The extension module injection_points has been added to the src/test/modules/injection_points directory. This module provides the infrastructure to utilize basic injection points. The injection_points module provides the following functions. [49cd2b9, f587338]
| Function Name | Description | Note |
|---|---|---|
| injection_points_attach | Create Injection Point | |
| injection_points_detach | Delete Injection Point | |
| injection_points_run | Execute Injection Point | |
| injection_points_set_local | Limit injection point execution to the current process | Limit injection point execution to the current process |
| injection_points_wakeup | Wakeup Injection Point |
PDF page 102
3.5.7 Test_radixtree
The extension test_radixtree has been added to the directory src/test/modules/test_radixtree. This extension is a test implementation of the paper “The Adaptive Radix Tree: ARTful Indexing for Main- Memory Databases” published by Viktor Leis, Alfons Kemper and Thomas Neumann in 2013 (https://ieeexplore.ieee.org/document/6544812). [ee1b30f]
| Function name | Description | Note |
|---|---|---|
| test_radixtree | Execute the Radix Tree test. |
3.5.8 Test_tidstore
The extension module test_tidstore has been added to the src/test/modules/test_tidstore directory. The test_tidstore module is a test module for efficiently storing large sets of TIDs. [30e1442]
PDF page 103
| Function Name | Description | Note |
|---|---|---|
| test_create | Creating a test | |
| check_set_block_offsetstest_is_fulltest_destroy | Validate TID in store against array Check for memory overflow Discarding the test | |
| do_set_block_offset | Set block offset value |
3.5.9 Xid_wraparound
The extension module xid_wraparound has been added to the src/test/modules/xid_wraparound directory. This module provides functions to quickly burn through lots of transaction IDs. [e255b64]
| Function Name | Description | Note |
|---|---|---|
| consume_xids | To proceed to the specified value for the transaction ID. | |
| consume_xids_until | To Proceed to the specified value of Transaction ID. |
PDF page 104
3.5.10 Miscellaneous
In addition to those described above, the following test extension modules have been added under the src/test/modules directory.
| Module Name | Description |
|---|---|
| test_dsa | Test module for Dynamic Shared Area (DSA). [325f540] |
| test_dsatest_dsm_registory | Test module for Dynamic Shared Area (DSA). [325f540] Test module for Dynamic Shared Memory (DSM) registration. [8b2bcf3] |
| test_dsm_registorytest_json_parser | Test module for Dynamic Shared Memory (DSM) registration. [8b2bcf3] Test module for JSON parsing. [3311ea8] |
| test_json_parsertest_resowner | Test module for JSON parsing. [3311ea8] Test module for resource owner feature. [b8bff07] |
PDF page 105
Reverted New Features This section describes major new features that were once committed but not adopted after the beta version. These features may be implemented in the next version.
Merge feature for multiple partitions [1adf16b]
Feature to split partitions [87c21bb]
Named NOT NULL constraints [b0e96f3]
WITHOUT OVERLAPS clause for primary/foreign keys [46a0cd4]
Automatic backtrace output feature [a740b21]
Self-join elimination feature [d3d55ce]
Add stratnum GiST support function [6db4598]
pg_wal_replay_wait function [06c418e]
Transform OR clause to ANY expression [72bd38c]
8 URL List
The links in this chapter are preserved from the source PDF’s URL list.
PDF page 106
9 Change History
This chapter preserves the source document’s revision history and publication credits.
PDF page 107
Change history
| Version | Date | Author | Description |
|---|---|---|---|
| 0.1 | Apr 11, 2024 | Noriyoshi Shinoda | Create an internal review version. Reviewers: Tomoo Takahashi Akiko Takeshima (Hewlett Packard Enterprise Japan) |
| 1.0 | May 25, 2024 | Noriyoshi Shinoda | Verification completed in PostgreSQL 17 Beta 1 environment. |
| 1.1 | Sep 30, 2024 | Noriyoshi Shinoda | Verification completed in PostgreSQL 17 GA environment. |