From d694e0bb793ebd6b392e6ef6a3b0a59ae66cbc95 Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Fri, 24 Jan 2020 20:42:52 +0900 Subject: 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 --- doc/src/sgml/adminpack.sgml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/adminpack.sgml b/doc/src/sgml/adminpack.sgml index 2655417366c..977073f7c8d 100644 --- a/doc/src/sgml/adminpack.sgml +++ b/doc/src/sgml/adminpack.sgml @@ -43,6 +43,13 @@ Write, or append to, a text file + + pg_catalog.pg_file_sync(filename text) + void + + Flush a file or directory to disk + + pg_catalog.pg_file_rename(oldname text, newname text , archivename text) boolean @@ -79,6 +86,18 @@ Returns the number of bytes written. + + pg_file_sync + + + pg_file_sync fsyncs the specified file or directory + named by filename. An error is thrown + on failure (e.g., the specified file is not present). Note that + has no effect on this function, + and therefore a PANIC-level error will not be raised even on failure to + flush database files. + + pg_file_rename -- cgit v1.2.3