pg_file_writewrites the specified
datainto the file named by
appendis false, the file must not already exist. If
appendis true, the file can already exist, and will be appended to if so. Returns the number of bytes written.
pg_file_syncfsyncs the specified file or directory named by
filename. An error is thrown on failure (e.g., the specified file is not present). Note that data_sync_retry 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_renamerenames a file. If
archivenameis omitted or NULL, it simply renames
newname(which must not already exist). If
archivenameis provided, it first renames
archivename(which must not already exist), and then renames
newname. In event of failure of the second rename step, it will try to rename
newnamebefore reporting the error. Returns true on success, false if the source file(s) are not present or not writable; other cases throw errors.
pg_file_unlinkremoves the specified file. Returns true on success, false if the specified file is not present or the
unlink()call fails; other cases throw errors.