Thread

  1. pg_recvlogical: honor source cluster file permissions for output files

    Fujii Masao <masao.fujii@gmail.com> — 2026-05-15T14:59:15Z

    Hi,
    
    The pg_recvlogical documentation says:
    
        pg_recvlogical will preserve group permissions on the received WAL files
        if group permissions are enabled on the source cluster.
    
    However, a user let me know that pg_recvlogical does not actually preserve
    group permissions on its output files, even when group permissions are enabled
    on the source cluster. This seems a bug.
    
    Commit c37b3d08ca6 attempted to preserve group permissions when group
    access is enabled on the source cluster. However, the output files are still
    created with a hard-coded S_IRUSR | S_IWUSR mode, so group-read permission
    is never applied.
    
    The attached patch fixes this by creating output files with pg_file_create_mode
    instead of the hard-coded mode. Since pg_recvlogical already sets
    umask(pg_mode_mask) based on the source cluster settings, this makes
    the output file permissions match the source cluster configuration as intended.
    
    The patch also updates the documentation wording from "received WAL files"
    to "output files", which better reflects what pg_recvlogical actually writes.
    
    I think this should be backpatched to all supported branches.
    
    Regards,
    
    -- 
    Fujii Masao