Re: Add pg_file_sync() to adminpack
Michael Paquier <[email protected]> Fri, 10 Jan 2020 20:16:20 +0900
| Newsgroups | gmane.comp.db.postgresql.devel.general |
|---|---|
| Message-ID | <[email protected]> |
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
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl4YXQQACgkQnvQgOdby QH0/sA//f+TDFPOzk190wFaCza6dgOjZWX5pO1bpAO/WZpQKhioHVxJoUGyzMxXW qtAY4Ou5S9ME2WEgvj19s/wBBytoOIzpubEIEX5MAePwrBq25FfgbZTclOl8I/VW 7ekyp2Ge5sCQDo44v3aTNbCh1m4hidFV6mk4PQNuWCoKryfvp+yTfCzXA749W8cM 24dXeqYmKQq+O/GAFNM4djSg4HxEi0vOQxnlSjlIOlwFDQJIcHJe5yglw/Kpt29a 0P55gBjRiawhYLEkxBIwKIVCD1zBzF73O4De3Lprt7XJeQpTYYZHLp2zghLcqYLC qQteAZ6x/GlBI0THO3Vm8IhwcLGi5JTtzesMUieNEHpe9JdUzpuGBbHe32zNC2Ii OUWk5sEUY0jpDnBXETn8DKi0K024sTAIokUQ5ydzGLMeIOFNG0uMTPqUL24ni5is mYGbvRAu7d4ZgAa+0tLCbqj9yc+yHak98Vd0iADJLo/HQoDmC0WPXUS/dsntUujp Uf5PW5MkFimwX0HDnplXiaK6lqX0ehxg9vs7QQfOwWTkPb6Onr/NeIAkhZL2Ru52 zK45qC6b5oEtOzkaA67U2kESoa24VfqJNXMqSDuW9kawBPIRp8NOJdQDHU+F5358 MlUTjsnqOAH1odRwoePxtwbvuaDZ5YfIa+vFpvOnV/twfk//ujQ= =TfwU -----END PGP SIGNATURE-----