From 7b540f8707b716181f2b0d3db68e92868d09d867 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Fri, 8 May 2020 19:38:46 -0400 Subject: [PATCH] pg_restore: Provide file name with one failure message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Almost all error messages already include file name where relevant, but this one had been overlooked. Repair. Backpatch to 9.5. Author: Euler Taveira Discussion: https://postgr.es/m/CAH503wA_VOrcKL_43p9atRejCDYmOZ8MzfK9S6TJrQqBqNeAXA@mail.gmail.com Reviewed-by: Álvaro Herrera --- src/bin/pg_dump/pg_backup_directory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c index 4aabb40f59..0ec049e6ea 100644 --- a/src/bin/pg_dump/pg_backup_directory.c +++ b/src/bin/pg_dump/pg_backup_directory.c @@ -406,8 +406,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)); } /*