From 76bb6dd2e56c14e947196e638f86982424c51254 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Tue, 13 Feb 2024 13:47:12 +0100 Subject: Skip .DS_Store files in server side utils The macOS Finder application creates .DS_Store files in directories when opened, which creates problems for serverside utilities which expect all files to be PostgreSQL specific files. Skip these files when encountered in pg_checksums, pg_rewind and pg_basebackup. This was extracted from a larger patchset for skipping hidden files and system files, where the concencus was to just skip these. Since this is equally likely to happen in every version, backpatch to all supported versions. Reported-by: Mark Guertin Reviewed-by: Michael Paquier Reviewed-by: Tobias Bussmann Discussion: https://postgr.es/m/E258CE50-AB0E-455D-8AAD-BB4FE8F882FB@gmail.com Backpatch-through: v12 --- doc/src/sgml/protocol.sgml | 2 +- doc/src/sgml/ref/pg_basebackup.sgml | 3 ++- doc/src/sgml/ref/pg_rewind.sgml | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 5482f1b7929..5ac937f5b67 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -2795,7 +2795,7 @@ The commands accepted in replication mode are: Files other than regular files and directories, such as symbolic links (other than for the directories listed above) and special - device files, are skipped. (Symbolic links + device and operating system files, are skipped. (Symbolic links in pg_tblspc are maintained.) diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml index 4e2db60b836..bab8c9e4806 100644 --- a/doc/src/sgml/ref/pg_basebackup.sgml +++ b/doc/src/sgml/ref/pg_basebackup.sgml @@ -726,7 +726,8 @@ PostgreSQL documentation The backup will include all files in the data directory and tablespaces, including the configuration files and any additional files placed in the directory by third parties, except certain temporary files managed by - PostgreSQL. But only regular files and directories are copied, except that + PostgreSQL and operating system files. But only regular files and + directories are copied, except that symbolic links used for tablespaces are preserved. Symbolic links pointing to certain directories known to PostgreSQL are copied as empty directories. Other symbolic links and special device files are skipped. diff --git a/doc/src/sgml/ref/pg_rewind.sgml b/doc/src/sgml/ref/pg_rewind.sgml index 272bd113b9a..53bd04772ad 100644 --- a/doc/src/sgml/ref/pg_rewind.sgml +++ b/doc/src/sgml/ref/pg_rewind.sgml @@ -311,8 +311,9 @@ GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, b backup_label, tablespace_map, pg_internal.init, - postmaster.opts and - postmaster.pid. + postmaster.opts, + postmaster.pid and. + .DS_Store. -- cgit v1.2.3