Re: Add pg_file_sync() to adminpack - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Add pg_file_sync() to adminpack
Date
Msg-id 20200110111620.GE250447@paquier.xyz
Whole thread Raw
In response to Re: Add pg_file_sync() to adminpack  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Add pg_file_sync() to adminpack  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Fri, Jan 10, 2020 at 06:50:12PM +0900, Fujii Masao wrote:
> I changed the doc that way. Thanks for the review!

+ <para>
+  <function>pg_file_sync</function> fsyncs the specified file or directory
+  named by <parameter>filename</parameter>.  Returns true on success,
+  an error is thrown otherwise (e.g., the specified file is not present).
+ </para>
What's the point of having a function that returns a boolean if it
just returns true all the time?  Wouldn't it be better to have a set
of semantics closer to the unlink() part, where the call of stat()
fails with an ERROR for (errno != ENOENT) and the fsync call returns
false with a WARNING?

+SELECT pg_file_sync('global'); -- sync directory
+ pg_file_sync
+--------------
+ t
+(1 row)
installcheck deployments may not like that.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Assert failure due to "drop schema pg_temp_3 cascade" fortemporary tables and \d+ is not showing any info after drooping temp tableschema
Next
From: Julien Rouhaud
Date:
Subject: Re: Add pg_file_sync() to adminpack