------------------------------------ * pg_file_sync * * We REVOKE EXECUTE on the function from PUBLIC. * Users can then grant access to it based on their policies. */
| 217 | * Users can then grant access to it based on their policies. |
| 218 | */ |
| 219 | Datum |
| 220 | pg_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 |
nothing calls this directly
no test coverage detected