aboutsummaryrefslogtreecommitdiff
path: root/src/include/fe_utils
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2023-09-06 16:27:16 -0700
committerNathan Bossart <nathan@postgresql.org>2023-09-06 16:27:16 -0700
commit8c16ad3b43299695f203f9157a2b27c22b9ed634 (patch)
tree895f2febff98495e9d446eab6a8d61b0ace2f37c /src/include/fe_utils
parentcccc6cdeb32f010f1cf777a9e9a85344a4317ab8 (diff)
downloadpostgresql-8c16ad3b43299695f203f9157a2b27c22b9ed634.tar.gz
postgresql-8c16ad3b43299695f203f9157a2b27c22b9ed634.zip
Allow using syncfs() in frontend utilities.
This commit allows specifying a --sync-method in several frontend utilities that must synchronize many files to disk (initdb, pg_basebackup, pg_checksums, pg_dump, pg_rewind, and pg_upgrade). On Linux, users can specify "syncfs" to synchronize the relevant file systems instead of calling fsync() for every single file. In many cases, using syncfs() is much faster. As with recovery_init_sync_method, this new option comes with some caveats. The descriptions of these caveats have been moved to a new appendix section in the documentation. Co-authored-by: Justin Pryzby Reviewed-by: Michael Paquier, Thomas Munro, Robert Haas, Justin Pryzby Discussion: https://postgr.es/m/20210930004340.GM831%40telsasoft.com
Diffstat (limited to 'src/include/fe_utils')
-rw-r--r--src/include/fe_utils/option_utils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/fe_utils/option_utils.h b/src/include/fe_utils/option_utils.h
index b7b0654cee7..6f3a965916a 100644
--- a/src/include/fe_utils/option_utils.h
+++ b/src/include/fe_utils/option_utils.h
@@ -14,6 +14,8 @@
#include "postgres_fe.h"
+#include "common/file_utils.h"
+
typedef void (*help_handler) (const char *progname);
extern void handle_help_version_opts(int argc, char *argv[],
@@ -22,5 +24,7 @@ extern void handle_help_version_opts(int argc, char *argv[],
extern bool option_parse_int(const char *optarg, const char *optname,
int min_range, int max_range,
int *result);
+extern bool parse_sync_method(const char *optarg,
+ DataDirSyncMethod *sync_method);
#endif /* OPTION_UTILS_H */