mirror of
https://github.com/postgres/postgres.git
synced 2026-02-15 08:37:56 -05:00
Improve readability and error messages in pg_backup_start_time.
Gurjeet Singh, with corrections by me.
This commit is contained in:
parent
c616d85f6b
commit
8507c2f856
1 changed files with 8 additions and 4 deletions
|
|
@ -611,14 +611,18 @@ pg_backup_start_time(PG_FUNCTION_ARGS)
|
|||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the backup label file.
|
||||
*/
|
||||
if (ferror(lfp) || FreeFile(lfp))
|
||||
/* Check for a read error. */
|
||||
if (ferror(lfp))
|
||||
ereport(ERROR,
|
||||
(errcode_for_file_access(),
|
||||
errmsg("could not read file \"%s\": %m", BACKUP_LABEL_FILE)));
|
||||
|
||||
/* Close the backup label file. */
|
||||
if (FreeFile(lfp))
|
||||
ereport(ERROR,
|
||||
(errcode_for_file_access(),
|
||||
errmsg("could not close file \"%s\": %m", BACKUP_LABEL_FILE)));
|
||||
|
||||
if (strlen(backup_start_time) == 0)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
|
|
|
|||
Loading…
Reference in a new issue