What is New in PostgreSQL 13
PostgreSQL 13 delivers strong improvements in performance, especially for vacuum and indexing, along with better scalability for large tables, enhanced logical replication, and new SQL features that simplify data handling. This release also focuses on making maintenance operations more efficient and improving overall query performance for both transactional and analytical workloads.
Key highlights include B-tree index deduplication, incremental sorting, parallel vacuum, and several monitoring enhancements.
Performance Improvements
PostgreSQL 13 introduces several important performance optimizations:
- B-tree index deduplication, which stores duplicate keys only once, significantly reducing index size for low-cardinality columns
- Incremental sorting that processes already-sorted data more efficiently
- Hash aggregation that can spill to disk when memory limits are reached
- Parallel vacuum for multiple indexes on the same table
- Improved autovacuum triggered by inserts to maintain visibility map and spread freezing work
These changes help reduce storage requirements and speed up both queries and maintenance tasks.
Logical Replication Enhancements
Logical replication receives useful upgrades in PostgreSQL 13:
- Streaming of large in-progress transactions to subscribers
- Support for two-phase commit in logical replication
- Row filtering on the publisher side
- Better control over replication slots with
max_slot_wal_keep_size
These improvements make logical replication more reliable and suitable for larger-scale data distribution scenarios.
Security Improvements
Security has been strengthened with the following changes:
- Default minimum TLS version raised to 1.2 (
ssl_min_protocol_version) - New
channel_bindingparameter in libpq to prevent man-in-the-middle attacks - More restrictive access to system tables for non-superusers
- Support for DER-encoded client certificates
SQL and Developer Features
PostgreSQL 13 adds several practical features for developers:
- New multirange data types for easier range handling
FETCH FIRST ... WITH TIESsupport- Improved JSON handling with
jsonb_set_lax() - New functions:
gen_random_uuid(),gcd(),lcm(), and numeric scaling functions - Support for
OVERRIDING USER VALUEon identity columns
Monitoring and Administration
| Area | New / Improved Feature |
|---|---|
| Vacuum & Autovacuum | Insert-triggered autovacuum and parallel index vacuum |
| Monitoring | pg_stat_progress_analyze, pg_shmem_allocations, and WAL usage tracking |
| Logging | log_statement_sample_rate and better parameter logging control |
| Replication | New progress views for basebackup and replication slots |
Other Notable Changes
Additional improvements include:
- Support for incremental sorting and better handling of inet sorting
- Extended statistics improvements for OR/IN conditions
- New wait events and better backend type visibility in logs
- Removal of several long-deprecated features and syntaxes
Migration Considerations
When upgrading to PostgreSQL 13, consider the following:
- Reindex B-tree indexes that benefit from deduplication to realize space savings
- Review autovacuum settings as insert-triggered vacuum behavior has changed
- Test logical replication setups with the new streaming and filtering features
- Update monitoring queries to use new statistics and progress views
PostgreSQL 13 offers excellent performance improvements and modern features while maintaining strong compatibility, making it a solid upgrade for most production environments.