Thread

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

    Srinath Reddy Sadipiralla <srinath2133@gmail.com> — 2026-05-16T15:21:54Z

    Hi Fujii-san,
    
    On Fri, May 15, 2026 at 8:29 PM Fujii Masao <masao.fujii@gmail.com> wrote:
    
    > 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 have reviewed, tested the patch and it LGTM, i think we can add
    a TAP test to verify the group permission, attached a diff patch
    for the same,
    
    I think this should be backpatched to all supported branches.
    >
    
    +1
    
    -- 
    Thanks,
    Srinath Reddy Sadipiralla
    EDB: https://www.enterprisedb.com/