pg_restore: Provide file name with one failure message
authorAlvaro Herrera <[email protected]>
Fri, 8 May 2020 23:38:46 +0000 (19:38 -0400)
committerAlvaro Herrera <[email protected]>
Fri, 8 May 2020 23:38:46 +0000 (19:38 -0400)
Almost all error messages already include file name where relevant, but
this one had been overlooked.  Repair.

Backpatch to 9.5.

Author: Euler Taveira <[email protected]>
Discussion: https://postgr.es/m/CAH503wA_VOrcKL_43p9atRejCDYmOZ8MzfK9S6TJrQqBqNeAXA@mail.gmail.com
Reviewed-by: Álvaro Herrera <[email protected]>
src/bin/pg_dump/pg_backup_directory.c

index 1a51b5cae1258e0a75986da957de89d1cb17c20b..7568bc1c0d388eee09e94e0decb797b4122b678f 100644 (file)
@@ -411,8 +411,8 @@ _PrintFileData(ArchiveHandle *AH, char *filename)
 
    free(buf);
    if (cfclose(cfp) !=0)
-       exit_horribly(modulename, "could not close data file: %s\n",
-                     strerror(errno));
+       exit_horribly(modulename, "could not close data file \"%s\": %s\n",
+                     filename, strerror(errno));
 }
 
 /*