Let’s check what’s new in PostgreSQL 15!
PostgreSQL is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance. It’s latest version, PostgreSQL 15 has been released on October 13, 2022.
PostgreSQL manages its internal security on a per-role basis. A role is generally regarded to be a user (a role that can log in), or a group (a role of which other roles are members). Permissions can be granted or revoked on any object down to the column level, and can also allow/prevent the creation of new objects at the database, schema or table levels. Standby servers can be synchronous or asynchronous. Synchronous standby servers can be specified in the configuration which determines which servers are candidates for synchronous replication. The first in the list that is actively streaming will be used as the current synchronous server. When this fails, the system fails over to the next in line.
PostgreSQL 15 builds on the performance improvements of recent releases with noticeable gains for managing workloads in both local and distributed deployments, including improved sorting. This release improves the developer experience with the addition of the popular
MERGE command, and adds more capabilities for observing the state of the database.
Table of contents:
- Improved Sort Performance and Compression
- Expressive Developer Features
- More Options with Logical Replication
- Logging and Configuration Enhancements
- Other Notable Changes
Improved Sort Performance and Compression
In this latest release, Postgre improves on its in-memory and on-disk sorting algorithms, with benchmarks showing speedups of 25% – 400% based on which data types are sorted. Using
count() as window functions also have performance benefits in PostgreSQL 15. Queries using
SELECT DISTINCT can now be executed in parallel.
Building on work from the previous Postgre release for allowing async remote queries, the PostgreSQL foreign data wrapper,
postgres_fdw, now supports asynchronous commits.
The performance improvements in PostgreSQL 15 extend to its archiving and backup facilities. PostgreSQL 15 adds support for LZ4 and Zstandard (zstd) compression to write-ahead log (WAL) files, which can have both space and performance benefits for certain workloads. On certain operating systems, PostgreSQL 15 adds support to prefetch pages referenced in WAL to help speed up recovery times. PostgreSQL’s built-in backup command,
pg_basebackup, now supports server-side compression of backup files with a choice of gzip, LZ4, and zstd. PostgreSQL 15 includes the ability to use custom modules for archiving, which eliminates the overhead of using a shell command.
Expressive Developer Features
Postgre includes the SQL standard
MERGE lets you write conditional SQL statements that can include
DELETE actions within a single statement.
This latest release adds new functions for using regular expressions to inspect strings:
regexp_substr(). PostgreSQL 15 also extends the
range_agg function to aggregate
multirange data types, which were introduced in the previous release.
PostgreSQL 15 lets users create views that query data using the permissions of the caller, not the view creator. This option, called
security_invoker, adds an additional layer of protection to ensure that view callers have the correct permissions for working with the underlying data.
More Options with Logical Replication
Postgre SQL 15 provides more flexibility for managing logical replication. This release introduces row filtering and column lists for publishers, letting users choose to replicate a subset of data from a table. PostgreSQL 15 adds features to simplify conflict management, including the ability to skip replaying a conflicting transaction and to automatically disable a subscription if an error is detected. This release also includes support for using two-phase commit (2PC) with logical replication.
Logging and Configuration Enhancements
Introducing a new logging format:
jsonlog. This new format outputs log data using a defined JSON structure, which allows PostgreSQL logs to be processed in structured logging systems.
This release gives database administrators more flexibility in how users can manage PostgreSQL configuration, adding the ability to grant users permission to alter server-level configuration parameters. Additionally, users can now search for information about configuration using the
\dconfig command from the
psql command-line tool.
Other Notable Changes
Server-level statistics are now collected in shared memory, eliminating both the statistics collector process and periodically writing this data to disk.
PostgreSQL 15 makes it possible to make an ICU collation the default collation for a cluster or an individual database.
This release also adds a new built-in extension,
pg_walinspect, that lets users inspect the contents of write-ahead log files directly from a SQL interface, and also revokes the
CREATE permission from all users except a database owner from the
public (or default) schema.
This latest version removes both the long-deprecated “exclusive backup” mode and support for Python 2 from PL/Python.