postgres.git / summary / log / commit / refs

commit    12da45742cfd15d9fab151b25400d96a1febcbde
Author:   Fujii Masao <fujii@postgresql.org>
Date:     Thu Aug 21 13:18:11 2025 +0000
First released in: 19.0

    Disallow server start with sync_replication_slots = on and wal_level < logical.
    
    Replication slot synchronization (sync_replication_slots = on)
    requires wal_level to be logical. This commit prevents the server
    from starting if sync_replication_slots is enabled but wal_level
    is set to minimal or replica.
    
    Failing early during startup helps users catch invalid configurations
    immediately, which is important because changing wal_level requires
    a server restart.
    
    Author: Fujii Masao <masao.fujii@gmail.com>
    Reviewed-by: Shveta Malik <shveta.malik@gmail.com>
    Discussion: https://postgr.es/m/CAH0PTU_pc3oHi__XESF9ZigCyzai1Mo3LsOdFyQA4aUDkm01RA@mail.gmail.com


src/backend/postmaster/postmaster.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index e01d9f0cfe8..e1d643b013d 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -854,6 +854,9 @@ PostmasterMain(int argc, char *argv[]) if (summarize_wal && wal_level == WAL_LEVEL_MINIMAL) ereport(ERROR, (errmsg("WAL cannot be summarized when \"wal_level\" is \"minimal\""))); + if (sync_replication_slots && wal_level < WAL_LEVEL_LOGICAL) + ereport(ERROR, + (errmsg("replication slot synchronization (\"sync_replication_slots\" = on) requires \"wal_level\" >= \"logical\""))); /* * Other one-time internal sanity checks can go here, if they are fast. [parent: 53eff471c69d]