MCPcopy Create free account
hub / github.com/apache/cloudberry / pg_file_sync

Function pg_file_sync

contrib/adminpack/adminpack.c:219–235  ·  view source on GitHub ↗

------------------------------------ * pg_file_sync * * We REVOKE EXECUTE on the function from PUBLIC. * Users can then grant access to it based on their policies. */

Source from the content-addressed store, hash-verified

217 * Users can then grant access to it based on their policies.
218 */
219Datum
220pg_file_sync(PG_FUNCTION_ARGS)
221{
222 char *filename;
223 struct stat fst;
224
225 filename = convert_and_check_filename(PG_GETARG_TEXT_PP(0));
226
227 if (stat(filename, &fst) < 0)
228 ereport(ERROR,
229 (errcode_for_file_access(),
230 errmsg("could not stat file \"%s\": %m", filename)));
231
232 fsync_fname_ext(filename, S_ISDIR(fst.st_mode), false, ERROR);
233
234 PG_RETURN_VOID();
235}
236
237/* ------------------------------------
238 * pg_file_rename - old version

Callers

nothing calls this directly

Calls 5

fsync_fname_extFunction · 0.85
statClass · 0.70
errcode_for_file_accessFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected