# New Features Summary

> The source document's overview of the release, benefits, and incompatibilities.

---

LLMS index: [llms.txt](/en/llms.txt)

---

<div class="feature-source-note"><span class="feature-edition-badge">GA</span><span><strong>Source pages:</strong> PDF 7-16</span><span><a href="https://github.com/nori-shinoda/documents/blob/1773200c5362476c4a549222b7d17fa91f546cae/postgresql15_ga_new_features_en_20221014-1.pdf">Original PDF on GitHub</a></span></div>

<p class="feature-page-marker" id="pgfeat-15-summary-pdf-page-7">PDF page 7</p>

More than 200 new features have been added to PostgreSQL 15. 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 {#pg15-2-1-improvements-to-adapt-to-large-scale-environments}

The following features have been added that can be applied to large scale environments:

#### Parallel Query Improvements {#pg15-p7-parallel-query-improvements}

Parallel queries now work for SELECT DISTINCT statements.

#### Improved Compression Method {#pg15-p7-improved-compression-method}

LZ4 and Zstandard are now available for compressing WALs and base backups. pg_receivewal command compression method has also been added.

#### Improvements to utilization statistics {#pg15-p7-improvements-to-utilization-statistics}

The stats collector process has been deprecated, and performance statistics have been changed from communicating using UDP to using a shared memory area.

### 2.2 Improve reliability {#pg15-2-2-improve-reliability}

PostgreSQL 15 implements the following enhancements to improve reliability.

#### Addition of archive library {#pg15-p7-addition-of-archive-library}

Archive logging can now be performed by a shared library. The Contrib module basic_archive has been added as a reference implementation.

#### Checkpoint log {#pg15-p7-checkpoint-log}

The default value for the log_checkpoints parameter has changed to "on". The checkpoint execution log will be output by default.

<p class="feature-page-marker" id="pgfeat-15-summary-pdf-page-8">PDF page 8</p>

### 2.3 Improved maintainability {#pg15-2-3-improved-maintainability}

The following features that can improve operability have been added.

#### Improvements in logical Replication {#pg15-p8-improvements-in-logical-replication}

Logical Replication has been greatly enhanced in PostgreSQL 15. Logical Replication can now only replicate tuples that meet certain conditions. The conditions for which tuples can be replicated are specified in the WHERE clause of the CREATE PUBLICATION or ALTER PUBLICATION statement. Replication columns can now be selected by specifying a list of columns in addition to the table in the CREATE PUBLICATION statement. Also, updates to specified LSNs can now be skipped.

#### Monitoring Enhancements {#pg15-p8-monitoring-enhancements}

The pg_stat_subscription_stats view has been added to check the status of errors that occur on the subscription worker in Logical Replication environment. Pg_stat_statements module provides information on temporary file I/O times and JITs. information can now be monitored.

#### Log File Format {#pg15-p8-log-file-format}

Log files can now be output in JSON format.

### 2.4 Improved in Programming {#pg15-2-4-improved-in-programming}

Added MERGE statement to SQL syntax. The MERGE statement can execute INSERT / UPDATE / DELETE processing at once depending on whether the join conditions of the tables match or not match.

### 2.5 Preparing for future new features {#pg15-2-5-preparing-for-future-new-features}

PostgreSQL 15 is now ready for features that will be provided in future versions.

#### Change table access method {#pg15-p8-change-table-access-method}

Added syntax to modify table access methods in the ALTER TABLE and ALTER MATERIALIZED VIEW statements.

<p class="feature-page-marker" id="pgfeat-15-summary-pdf-page-9">PDF page 9</p>

### 2.6 Incompatibility {#pg15-2-6-incompatibility}

In PostgreSQL 15, the following specifications have been changed from PostgreSQL 14.

#### 2.6.1 Access privileges to the PUBLIC schema {#pg15-2-6-1-access-privileges-to-the-public-schema}

Previously, the public schema had CREATE and USAGE privileges for all users (PUBLIC). In PostgreSQL 15, access to the public schema is limited to the database owner (pg_database_owner role). The owner of the public schema has also changed to pg_database_owner. With this change, it will be in the recommended state after CVE-2018-1058.

**Example 1.** Access privileges to the PUBLIC schema

```text
postgres=# CREATE USER demo PASSWORD 'demo' ;
CREATE ROLE
postgres=# \connect postgres demo
You are now connected to database "postgres" as user "demo".
postgres=> CREATE TABLE public.data1(c1 INT, c2 VARCHAR(10)) ;
ERROR:  permission denied for schema public
LINE 1: CREATE TABLE public.data1(c1 INT, c2 VARCHAR(10)) ;
                     ^
postgres=> CREATE VIEW public.view1 AS SELECT 1 ;
ERROR:  permission denied for schema public
postgres=> CREATE SEQUENCE public.seq1 ;
ERROR:  permission denied for schema public
```

#### 2.6.2 Exclusive backup mode {#pg15-2-6-2-exclusive-backup-mode}

The deprecated exclusive backup mode has been removed. Exclusive backup prohibits multiple simultaneous backups. To start an exclusive backup, set the exclusive parameter of the pg_start_backup function to true (default). The function name used to start/end online backup has changed due to the deletion of exclusive backup mode.

<p class="feature-page-marker" id="pgfeat-15-summary-pdf-page-10">PDF page 10</p>

**Table 4.** Function name change

| Operation | PostgreSQL 14 | PostgreSQL 15 | Note |
| --- | --- | --- | --- |
| Start backup | pg_start_backup | pg_backup_start |  |
| Stop backup | pg_stop_backup | pg_backup_stop |  |
| Backup confirmation | pg_is_in_backup | - | Removed |
| Backup start time | pg_backup_start_time | - | Removed |

**Example 2.** Execute online backup

```text
postgres=# SELECT pg_backup_start('start online backup#1', false) ;
 pg_backup_start
-----------------
 0/4000028
(1 row)
postgres=# \! cp -r data backup
postgres=# SELECT pg_backup_stop(true) ;
NOTICE:  all required WAL segments have been archived
                              pg_backup_stop
---------------------------------------------------------------------------
 (0/4000138,"START WAL LOCATION: 0/4000028 (file 000000010000000000000004)+
 CHECKPOINT LOCATION: 0/4000060                                           +
 BACKUP METHOD: streamed                                                  +
 BACKUP FROM: primary                                                     +
START TIME: 2022-10-13 23:03:20 JST                                      +
 LABEL: start online backup#1                                             +
 START TIMELINE: 1                                                        +
 ","")
(1 row)
```

#### 2.6.3 Psql {#pg15-2-6-3-psql}

The psql command has the following changes related to compatibility.

##### Supported version of the connected instance {#pg15-p10-supported-version-of-the-connected-instance}

Connections to servers prior to PostgreSQL 9.2 are no longer supported. A warning message will be output when connecting to a server with PostgreSQL 9.2 or earlier.

<p class="feature-page-marker" id="pgfeat-15-summary-pdf-page-11">PDF page 11</p>

##### Password change {#pg15-p11-password-change}

The behavior of the \password command has been changed. Previously, the password of the user specified at login was changed, but the user is determined based on the result of the execution of the SELECT CURRENT_USER statement. This changes the behavior of the SET SESSION AUTHORIZATION statement. In addition, the name of the user to be changed is now displayed at the prompt. This specification change will be backported to the previous version.

**Example 3.** Behavior of PostgreSQL 14

```text
postgres=# SET SESSION AUTHORIZATION demo ;
SET
postgres=> \password
Enter new password: <<PASSWORD>> <- Password of postgres user
Enter it again: <<PASSWORD>> <- Password of postgres user
ERROR:  must be superuser to alter superuser roles or change superuser attribute
postgres=>
```

**Example 4.** Behavior of PostgreSQL 15

```text
postgres=# SET SESSION AUTHORIZATION demo ;
SET
postgres=> \password
Enter new password for user "demo": <<PASSWORD>> <- Password of demo user
Enter it again: <<PASSWORD>> <- Password of demo user
postgres=>
```

##### Displaying Multiple Results {#pg15-p11-displaying-multiple-results}

In previous versions, the psql command would print only the last result if multiple result sets were returned; PostgreSQL 15 prints all results. To change to the same behavior as in the previous version, execute the command \set SHOW_ALL_RESULTS off.

**Example 5.** Behavior of PostgreSQL 14

```text
postgres=> SELECT 1 \; SELECT 2 ;
 ?column?
----------
        2
(1 row)
```

<p class="feature-page-marker" id="pgfeat-15-summary-pdf-page-12">PDF page 12</p>

**Example 6.** Behavior of PostgreSQL 15

```text
postgres=> SELECT 1 \; SELECT 2 ;
 ?column?
----------
        1
(1 row)
 ?column?
----------
        2
(1 row)
postgres=> \set SHOW_ALL_RESULTS off
postgres=> SELECT 1 \; SELECT 2 ;
 ?column?
----------
        2
(1 row)
```

##### --Single-transaction option behavior {#pg15-p12-single-transaction-option-behavior}

If the --single-transaction option is specified and an error occurs with the ON_ERROR_STOP variable defined, a ROLLBACK statement is automatically executed.

#### 2.6.4 Literal {#pg15-2-6-4-literal}

Literal strings that begin with a number were previously split into a number part and a string part, but PostgreSQL 15 causes an error.

**Example 7.** Behavior of PostgreSQL 14

```text
postgres=> SELECT 123abc ;
abc
-----
 123
(1 row)
```

<p class="feature-page-marker" id="pgfeat-15-summary-pdf-page-13">PDF page 13</p>

**Example 8.** Behavior of PostgreSQL 15

```text
postgres=> SELECT 123abc ;
ERROR:  trailing junk after numeric literal at or near "123a"
LINE 1: SELECT 123abc;
               ^
```

#### 2.6.5 ANALYZE {#pg15-2-6-5-analyze}

The ANALYZE statement has been changed to use maintenance_io_concurrency instead of effective_io_concurrency for execution. This specification will be backported to PostgreSQL 14.

#### 2.6.6 Python 2 {#pg15-2-6-6-python-2}

Python 2 support in PL/Python has been removed due to the expiration of Python 2.7 support; Python 2 is rejected when running the 'configure' command. Python 3.2 and above is supported.

**Example 9.** Python 2 only environment

```text
$ ./configure --with-python
checking build system type... x86_64-pc-linux-gnu
…
configure: using perl 5.26.3
checking for python3... no
checking for python... /usr/bin/python
configure: using python 2.7.18 (default, Feb 10 2022, 14:26:12)
configure: error: Python version 2.7 is too old (version 3 or later is required)
```

```text
The extensions such as hstore_plpython2u, jsonb_plpython2u, and ltree_plpython2u have also been
removed.
```

#### 2.6.7 Date_bin {#pg15-2-6-7-date-bin}

Negative values can no longer be specified for the interval of the date_bin function. This specification change will be backported to the previous version.

<p class="feature-page-marker" id="pgfeat-15-summary-pdf-page-14">PDF page 14</p>

**Example 10.** Execute date\_bin function

```text
postgres=> SELECT date_bin('-2'::interval, timestamp '1970-01-01 01:00:00',
timestamp '1970-01-01 00:00:00') ;
ERROR:  stride must be greater than zero
```

#### 2.6.8 Pg_amcheck {#pg15-2-6-8-pg-amcheck}

The --quiet option (short -q) of the pg_amcheck command has been removed. This fix will also be backported to PostgreSQL 14.

#### 2.6.9 Pgcrypto {#pg15-2-6-9-pgcrypto}

The proprietary built-in encryption algorithm has been removed and OpenSSL is now required.

#### 2.6.10 Pg_dump / pg_dumpall {#pg15-2-6-10-pg-dump-pg-dumpall}

Removed the upgrade feature from versions prior to PostgreSQL 9.2. Also, the --no-synchronizedsnapshots option has been removed.

#### 2.6.11 Pg_upgrade {#pg15-2-6-11-pg-upgrade}

Removed the upgrade feature from versions prior to PostgreSQL 9.2.

#### 2.6.12 Postmaster {#pg15-2-6-12-postmaster}

The postmaster startup option --forkboot has been changed to --forkaux.

#### 2.6.13 Array_to_tsvector {#pg15-2-6-13-array-to-tsvector}

Disallow making an empty lexeme via array_to_tsvector function.

**Example 11.** Execute the array\_to\_tsvector function

```text
postgres=> SELECT array_to_tsvector(ARRAY['base','hidden','rebel', '']) ;
ERROR:  lexeme array may not contain empty strings
```

<p class="feature-page-marker" id="pgfeat-15-summary-pdf-page-15">PDF page 15</p>

#### 2.6.14 Xml2 {#pg15-2-6-14-xml2}

The xml_is_well_formed function has been removed from the Contrib module xml2.

#### 2.6.15 Pipeline mode {#pg15-2-6-15-pipeline-mode}

Removed support for PQsendQuery function in pipeline mode. Use the PQsendQueryParams function instead.

#### 2.6.16 Extension {#pg15-2-6-16-extension}

CREATE OR REPLACE statements for existing objects are disallowed unless they already belong to the extension.

<p class="feature-page-marker" id="pgfeat-15-summary-pdf-page-16">PDF page 16</p>
