pgsql: Prevent pg_enable/disable_data_checksums() on standby

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Prevent pg_enable/disable_data_checksums() on standby
Date: 2026-04-30 11:46:34
Message-ID: E1wIPqk-003SOT-0X@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Prevent pg_enable/disable_data_checksums() on standby

These functions missed a RecoveryInProgress() check, allowing them to
be called on a hot standby. Enabling, or disabling, checksums on the
standby only would cause the cluster to get out of sync and replaying
checksum transitions to fail.

Author: Satyanarayana Narlapuram <satyanarlapuram(at)gmail(dot)com>
Reviewed-by: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
Reviewed-by: Tomas Vondra <tomas(at)vondra(dot)me>
Reviewed-by: Daniel Gustafsson <daniel(at)yesql(dot)se>
Discussion: https://postgr.es/m/CAHg+QDfRk4-S7DMmdbXJnQ-xF=sUpMAKuh8b83ObLqYVKx5QLA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b120358c612dce62b493da7682b4df90a10783c9

Modified Files
--------------
src/backend/postmaster/datachecksum_state.c | 4 ++++
1 file changed, 4 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-04-30 11:46:35 pgsql: Fix data_checksum GUC show_hook
Previous Message Amit Kapila 2026-04-30 11:11:34 pgsql: Fix double table_close of sequence_rel in copy_sequences().