aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2020-01-24 20:42:52 +0900
committerFujii Masao <fujii@postgresql.org>2020-01-24 20:42:52 +0900
commitd694e0bb793ebd6b392e6ef6a3b0a59ae66cbc95 (patch)
treee53f68bd8ce500aada11ebd776735d139b572618 /src/backend
parentcc25464763f0211e59a209eb50a7b7a79449051f (diff)
downloadpostgresql-d694e0bb793ebd6b392e6ef6a3b0a59ae66cbc95.tar.gz
postgresql-d694e0bb793ebd6b392e6ef6a3b0a59ae66cbc95.zip
Add pg_file_sync() to adminpack extension.
This function allows us to fsync the specified file or directory. It's useful, for example, when we want to sync the file that pg_file_write() writes out or that COPY TO exports the data into, for durability. Author: Fujii Masao Reviewed-By: Julien Rouhaud, Arthur Zakirov, Michael Paquier, Atsushi Torikoshi Discussion: https://www.postgresql.org/message-id/CAHGQGwGY8uzZ_k8dHRoW1zDcy1Z7=5GQ+So4ZkVy2u=nLsk=hA@mail.gmail.com
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/storage/file/fd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index fa79b45f631..b5f4df6a485 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -319,7 +319,6 @@ static void pre_sync_fname(const char *fname, bool isdir, int elevel);
static void datadir_fsync_fname(const char *fname, bool isdir, int elevel);
static void unlink_if_exists_fname(const char *fname, bool isdir, int elevel);
-static int fsync_fname_ext(const char *fname, bool isdir, bool ignore_perm, int elevel);
static int fsync_parent_path(const char *fname, int elevel);
@@ -3376,7 +3375,7 @@ unlink_if_exists_fname(const char *fname, bool isdir, int elevel)
*
* Returns 0 if the operation succeeded, -1 otherwise.
*/
-static int
+int
fsync_fname_ext(const char *fname, bool isdir, bool ignore_perm, int elevel)
{
int fd;