The end of the March Commitfest concludes the acceptance of patches for PostgreSQL 16. Let’s take a look at some exciting new updates it introduced.
I hope that this review together with the previous articles in the series (2022-07, 2022-09, 2022-11, 2023-01) will give you a coherent idea of the new features of PostgreSQL 16.
As usual, the March Commitfest introduces a ton of new changes. I’ve split them into several sections for convenience.
- pg_stat_io: input/output statistics
- Counter for new row versions moved to another page when performing an UPDATE
- pg_buffercache: new pg_buffercache_usage_counts function
- Normalization of DDL and service commands, continued
- EXPLAIN (generic_plan): generic plan of a parameterized query
- auto_explain: logging the query ID
- PL/pgSQL: GET DIAGNOSTICS .. PG_ROUTINE_OID
- psql: variables SHELL_ERROR and SHELL_EXIT_CODE
- psql: \watch and the number of repetitions
- psql:\df+ does not show the source code of functions
- pg_dump: support for LZ4 and zstd compression methods
- pg_dump and partitioned tables
- pg_verifybackup --progress
- libpq: balancing connections
Server administration and maintenance
- initdb: setting configuration parameters during cluster initialization
- Autovacuum: balancing I/O impact on the fly
- Managing the size of shared memory for vacuum and analyze
- VACUUM for TOAST tables only
- The vacuum_defer_cleanup_age parameter has been removed
- pg_walinspect: interpretation of the end_lsn parameter
- pg_walinspect: pg_get_wal_fpi_info → pg_get_wal_block_info
- ICU: UNICODE collation
- ICU: Canonization of locales
- ICU: custom rules for customizing the sorting algorithm
- libpq: new parameter require_auth
- scram_iterations: iteration counter for password encryption using SCRAM-SHA-256
SQL functions and commands
- SQL/JSON standard support
- New functions pg_input_error_info and pg_input_is_valid
- The Daitch-Mokotoff Soundex
- New functions array_shuffle and array_sample
- New aggregate function any_value
- COPY: inserting default values
- timestamptz: adding and subtracting time intervals
- XML: formatting values
- pg_size_bytes: support for "B"
- New functions: erf, erfc
- Parallel execution of full and right hash joins
- Options for the right antijoin
- Relation extension mechanism rework
- Don’t block HOT update by BRIN index
- postgres_fdw: aborting transactions on remote servers in parallel mode
- force_parallel_mode → debug_parallel_query
- Direct I/O (for developers only)
- Logical replication from a physical replica
- Using non-unique indexes with REPLICA IDENTITY FULL
- Initial synchronization in binary format
- Privileges for creating subscriptions and applying changes
- Committing changes in parallel mode (for developers only)
PostgreSQL 14 Internals
I’m excited to announce that the translation of the “PostgreSQL 14 Internals” book is finally complete thanks to the amazing work of Liudmila Mantrova.
The final part of the book considers each of the index types in great detail. It explains and demonstrates how access methods, operator classes, and data types work together to serve a variety of distinct needs.
You can download a PDF version of this book for free. We are also working on making it available on a print-on-demand service.
Your comments are very welcome. Contact us at email@example.com.
We continue to follow the news of the PostgreSQL 16 release, and today, the results of the fourth CommitFest are on the table. Let’s have a look.
If you missed the previous CommitFests, check out our reviews for 2022-07, 2022-09 and 2022-11.
Here are the patches I want to talk about this time:
- New function: random_normal
- Input formats for integer literals
- Goodbye, postmaster
- Parallel execution for string_agg and array_agg
- New parameter: enable_presorted_aggregate
- Planner support function for working with window functions
- Optimized grouping of repeating columns in GROUP BY and DISTINCT
- VACUUM parameters: SKIP_DATABASE_STATS and ONLY_DATABASE_STATS
- pg_dump: lock tables in batches
- PL/pgSQL: cursor variable initialization
- Roles with the CREATEROLE attribute
- Setting parameter values at the database and user level
- New parameter: reserved_connections
- postgres_fdw: analyzing foreign tables with TABLESAMPLE
- postgres_fdw: batch insert records during partition key updates
- pg_ident.conf: new ways to identify users in PostgreSQL
- Query jumbling for DDL and utility statements
- New function: bt_multi_page_stats
- New function: pg_split_walfile_name
- pg_walinspect, pg_waldump: collecting page images from WAL
Browse by keywords:
We continue to follow the news of the upcoming PostgreSQL 16. The third CommitFest concluded in early December. Let's look at the results.
If you missed the previous CommitFests, check out our reviews: 2022-07, 2022-09.
Here are the patches I want to talk about:
- meson: a new source code build system
- Documentation: a new chapter on transaction processing
- psql: \d+ indicates foreign partitions in a partitioned table
- psql: extended query protocol support
- Predicate locks on materialized views
- Tracking last scan time of indexes and tables
- pg_buffercache: a new function pg_buffercache_summary
- walsender displays the database name in the process status
- Reducing the WAL overhead of freezing tuples
- Reduced power consumption when idle
- postgres_fdw: batch mode for COPY
- Modernizing the GUC infrastructure
- Hash index build optimization
- MAINTAIN ― a new privilege for table maintenance
- SET ROLE: better role change management
- Support for file inclusion directives in pg_hba.conf and pg_ident.conf
- Regular expressions support in pg_hba.conf
PostgreSQL 14 Internals, Part IV
I’m excited to announce that the translation of Part IV of the “PostgreSQL 14 Internals” book is published. This part delves into the inner workings of the planner and the executor, and it took me a couple of hundred pages to get through all the magic that covers this advanced technology.
You can download the book freely in PDF. The last part is yet to come, stay tuned!
I’d like to thank Alejandro García Montoro, Goran Pulevic, and Japin Li for their feedback and suggestions. Your comments are much appreciated. Contact us at firstname.lastname@example.org.
It’s official! PostgreSQL 15 is out, and the community is abuzz discussing all the new features of the fresh release.
Meanwhile, the October CommitFest for PostgreSQL 16 had come and gone, with its own notable additions to the code.
If you missed the July CommitFest, our previous article will get you up to speed in no time.
Here are the patches I want to talk about:
- SYSTEM_USER function
- Frozen pages/tuples information in autovacuum's server log
- pg_stat_get_backend_idset returns the actual backend ID
- Improved performance of ORDER BY / DISTINCT aggregates
- Faster bulk-loading into partitioned tables
- Optimized lookups in snapshots
- Bidirectional logical replication
- pg_auth_members: pg_auth_members: role membership granting management
- pg_auth_members: role membership and privilege inheritance
- pg_receivewal and pg_recvlogical can now handle SIGTERM
Queries in PostgreSQL: 7. Sort and merge
In the previous articles, covered query execution stages, statistics, sequential and index scan, and two of the three join methods: nested loop and hash join. This last article of the series will cover the merge algorithm and sorting. I will also demonstrate how the three join methods compare against each other.
PostgreSQL 14 Internals, Part III
I’m excited to announce that the translation of Part III of the “PostgreSQL 14 Internals” book is finished. This part is about a diverse world of locks, which includes a variety of heavyweight locks used for all kinds of purposes, several types of locks on memory structures, row locks which are not exactly locks, and even predicate locks which are not locks at all.
Please download the book freely in PDF. We have two more parts to come, so stay tuned!
Your comments are much appreciated. Contact us at email@example.com.
PostgreSQL 14 Internals, Part II
I’m pleased to announce that Part II of the “PostgreSQL 14 Internals” book is available now. This part explores the purpose and design of the buffer cache and explains the need for write-ahead logging.
Please download the book freely in PDF. There are three more parts to come, so stay tuned!
Thanks to Matthew Daniel who has spotted a blunder in typesetting of Part I. Your comments are much appreciated; write us to firstname.lastname@example.org.
August is a special month in PostgreSQL release cycle. PostgreSQL 15 isn't even officially out yet, but the first CommitFest for the 16th release has already been held.
Let's compile the server and check out the cool new stuff!
So far we have covered query execution stages, statistics, sequential and index scan, and have moved on to joins.
The previous article focused on the nested loop join, and in this one I will explain the hash join. I will also briefly mention group-bys and distincs.
PostgreSQL 14 Internals
This is a short note to inform that we are translating my book “PostgreSQL 14 Internals,” recently published in Russian. Liudmila Mantrova, who helped me a lot with the editing of the original, is working on the translation, too. My gratitude to her is beyond words.
The book is largely based on the articles I’ve published here and training courses my colleagues and I are developing. It dives deep into the problems of data consistency and isolation, explaining implementation details of multiversion concurrency control and snapshot isolation, buffer cache and write-ahead log, and then moves on to the twists and turns of the locking system. The book also covers the questions of planning and executing SQL queries, including the discussion of data access and join methods, statistics, and various index types.
The book is freely available in PDF. The translation is in progress, and for now only Part I of the book is ready. Other parts will follow soon, so stay tuned!
So far we've discussed query execution stages, statistics, and the two basic data access methods: Sequential scan and Index scan.
The next item on the list is join methods. This article will remind you what logical join types are out there, and then discuss one of three physical join methods, the Nested loop join. Additionally, we will check out the row memoization feature introduced in PostgreSQL 14.
Joins are the primary feature of SQL, the foundation that enables its power and agility. Sets of rows (whether pulled directly from a table or formed as a result of an operation) are always joined together in pairs. There are several types of joins.
New TOAST in town: the “pluggable TOAST API” concept and what it means for the community
While preparing for my talk to be given at PGCon 2022, I decided to share some important thoughts with the Postgres community. We’re going to change the way TOAST works, and it will have a positive impact on lives of many PostgreSQL contributors, developers and users in the upcoming years. It is also the rare case when I tackle commercial aspects of open source development, so it’s worth reading for everyone.