In every release of PostgreSQL, it introduces several changes to improve performance, usability, and database management. PostgreSQL 19 updates some existing configuration parameters by changing their default values compared to PostgreSQL 18. In this blog, we will explore these updated parameters, compare their values between PostgreSQL 18 and PostgreSQL 19, and understand how these changes affect database operations.
The updated parameters in postgres 19 are listed below:
- default_toast_compression
- jit
- log_lock_waits
- log_min_messages
- max_locks_per_transaction
Let’s start with each parameter in more detail.
1.default_toast_compression
Check the value of the parameter named default_toast_compression in postgres version 18.
postgres=# show default_toast_compression ;
Result:
default_toast_compression
---------------------------
pglz
(1 row)
Now, check this in postgresql version 19.
Result:
default_toast_compression
---------------------------
lz4
(1 row)
Change:
The pglz toast compression is changed to lz4 in PostgreSQL version 19. This is because lz4 provides good compression and decompression speed compared to pglz toast compression.Now, check this parameter’s metadata from pg_settings like this.
postgres=# select * from pg_settings where name = 'default_toast_compression';
Result:
-[ RECORD 1 ]---+-------------------------------------------------------------
name | default_toast_compression
setting | pglz
unit |
category | Client Connection Defaults / Statement Behavior
short_desc | Sets the default compression method for compressible values.
extra_desc |
context | user
vartype | enum
source | default
min_val |
max_val |
enumvals | {pglz,lz4}
boot_val | pglz
reset_val | pglz
sourcefile |
sourceline |
pending_restart | f
The available compression algorithms are pglz and lz4.
2. jit
Check the value of jit in PostgreSQL version 18.
postgres=# show jit;
Result:
jit
-----
on
(1 row)
Check this in postgresql version 19.
Result:
jit
-----
off
(1 row)
Change:
The jit is disabled by default in PostgreSQL version 19. Jit provides some overhead during the execution of small queries. Some ERPs like Odoo execute a huge number of small queries. So by disabling the jit, we can get better execution for the small queries.
Check this parameter’s metadata from pg_settings like this.
postgres=# select * from pg_settings where name = 'jit';
Result:
-[ RECORD 1 ]---+-------------------------------------
name | jit
setting | on
unit |
category | Query Tuning / Other Planner Options
short_desc | Allow JIT compilation.
extra_desc |
context | user
vartype | bool
source | default
min_val |
max_val |
enumvals |
boot_val | on
reset_val | on
sourcefile |
sourceline |
pending_restart | f
3.log_lock_waits
Check the value of the parameter named log_lock_waits.
postgres=# show log_lock_waits;
Result:
log_lock_waits
----------------
off
(1 row)
Check this in PostgreSQL version 19.
Result:
log_lock_waits
----------------
on
(1 row)
Change:
The log_lock_waits parameter is changed from off to on in postgresql version 19. Based on this, we can get the lock wait information from the postgresql logfile directly.
Check this parameter’s metadata from pg_settings like this.
postgres=# select * from pg_settings where name = 'log_lock_waits';
Result:
-[ RECORD 1 ]---+------------------------------------
name | log_lock_waits
setting | off
unit |
category | Reporting and Logging / What to Log
short_desc | Logs long lock waits.
extra_desc |
context | superuser
vartype | bool
source | default
min_val |
max_val |
enumvals |
boot_val | off
reset_val | off
sourcefile |
sourceline |
pending_restart | f
4.log_min_messages
Check the value of the parameter named log_min_messages.
postgres=# show log_min_messages;
Result:
log_min_messages
------------------
warning
(1 row)
Check this in PostgreSQL version 19.
log_min_messages
------------------
warning
(1 row)
Change:
Here, we can see the value is the same in PostgreSQL versions 18 and 19. The log_min_messages parameter’s datatype is changed from enum to string to provide more flexibility when handling log message levels.
Check this parameter’s metadata from pg_settings like this.
postgres=# select * from pg_settings where name = 'log_min_messages';
Result:
-[ RECORD 1 ]---+-----------------------------------------------------------------------------------------------------
name | log_min_messages
setting | debug1
unit |
category | Reporting and Logging / When to Log
short_desc | Sets the message levels that are logged.
extra_desc | Each level includes all the levels that follow it. The later the level, the fewer messages are sent.
context | superuser
vartype | enum
source | configuration file
min_val |
max_val |
enumvals | {debug5,debug4,debug3,debug2,debug1,info,notice,warning,error,log,fatal,panic}
boot_val | warning
reset_val | debug1
sourcefile | /var/lib/postgresql/18/main/postgresql.auto.conf
sourceline | 13
pending_restart | f
5.max_locks_per_transaction
Check the value of the parameter named max_locks_per_transaction.
postgres=# show max_locks_per_transaction;
Result:
max_locks_per_transaction
---------------------------
64
(1 row)
Check this in PostgreSQL version 19.
max_locks_per_transaction
---------------------------
128
(1 row)
Change:
The value of max_locks_per_transaction is increased from 64 to 128, and this helps to reduce the amount of lock contention. The lock contention can easily occur from huge complex queries that are executed in a transaction.
Check this parameter’s metadata from pg_settings like this.
postgres=# select * from pg_settings where name = 'max_locks_per_transaction';
Result:
-[ RECORD 1 ]---+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
name | max_locks_per_transaction
setting | 64
unit |
category | Lock Management
short_desc | Sets the maximum number of locks per transaction.
extra_desc | The shared lock table is sized on the assumption that at most "max_locks_per_transaction" objects per server process or prepared transaction will need to be locked at any one time.
context | postmaster
vartype | integer
source | default
min_val | 10
max_val | 2147483647
enumvals |
boot_val | 64
reset_val | 64
sourcefile |
sourceline |
pending_restart | f
PostgreSQL 19 introduces some updates to existing configuration parameters, including changes in compression method, logging mechanism, and lock management settings.
Knowing these changes helps database administrators and developers get their systems ready before upgrading to PostgreSQL 19.By comparing these parameters with PostgreSQL 18, it becomes easier to spot the improvements and change the settings to fit the workload needs.