Greetings David, Michael, all, * David Steele (da...@pgmasters.net) wrote: > On 3/15/18 3:17 AM, Michael Paquier wrote: > > On Wed, Mar 14, 2018 at 02:08:19PM -0400, David Steele wrote: > > > > When taking a base backup from a data folder which has group access, > > then the tar data, as well as the untar'ed data, are still using > > 0600 as umask for files and 0700 for folders. Is that an expected > > behavior? I would have imagined that sendFileWithContent() and > > _tarWriteDir() should enforce the file mode to have group access if the > > cluster has been initialized to work as such. > > We can certainly make base backup understand the group access mode. > Should we continue hard-coding the mode, or use the actual dir/file mode?
Given that we're already, as I recall, including the owner/group of the file being backed up through pg_basebackup in the tarball, it seems like we should be including whatever the current dir/file mode is too. Those files may not have anything to do with PostgreSQL, after all, and a 'natural' tar of the directory would capture that information too. > > Still as this is a > > feature aimed at being used for custom backups, that's not really a > > blocker I guess. > > Seems like a good thing to do, though, so I'll have a look for the next > patch. +1. > > Visibly there would be no need for a -g switch in > > pg_basebackup as it is possible to guess from the received untar'ed > > files what should be the permissions of the data based on what is > > received in pg_basebackup.c. It would also be necessary to change the > > permissions of pg_wal as this is created before receiving any files. > > This part might be trickier. This seems like another case where what we should be doing, and what people will be expecting, I'd think, is just what they're used to tar doing in these cases- which would be setting the dir/file mode for each file based on what's in the tarball. Again, the files which are in the data dir are, sadly, not always just those that PG is familiar with. Thanks! Stephen
signature.asc
Description: PGP signature