Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b3f32a6

Browse files
committed
Fix misuse of pg_log_info() for details/hints.
Two places in pg_dump_sort.c were using pg_log_info() to add more details to a message printed with pg_log_warning(). This is bad, because at default verbosity level we would print the warning line but not the details. One should use pg_log_warning_detail() or pg_log_warning_hint() instead. Commit 9a374b7 got rid of most such abuses, but unaccountably missed these. Noted while studying a bug report from Sami Imseih. Back-patch to v15 where 9a374b7 came in. (Prior versions don't have the missing-details misbehavior, for reasons I didn't bother to track down.) Discussion: https://postgr.es/m/2C1933AB-C2F8-499B-9D18-4AC1882256A0@amazon.com
1 parent d0f4824 commit b3f32a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bin/pg_dump/pg_dump_sort.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1233,9 +1233,9 @@ repairDependencyLoop(DumpableObject **loop,
12331233
"there are circular foreign-key constraints among these tables:",
12341234
nLoop));
12351235
for (i = 0; i < nLoop; i++)
1236-
pg_log_info(" %s", loop[i]->name);
1237-
pg_log_info("You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.");
1238-
pg_log_info("Consider using a full dump instead of a --data-only dump to avoid this problem.");
1236+
pg_log_warning_detail("%s", loop[i]->name);
1237+
pg_log_warning_hint("You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.");
1238+
pg_log_warning_hint("Consider using a full dump instead of a --data-only dump to avoid this problem.");
12391239
if (nLoop > 1)
12401240
removeObjectDependency(loop[0], loop[1]->dumpId);
12411241
else /* must be a self-dependency */
@@ -1253,7 +1253,7 @@ repairDependencyLoop(DumpableObject **loop,
12531253
char buf[1024];
12541254

12551255
describeDumpableObject(loop[i], buf, sizeof(buf));
1256-
pg_log_info(" %s", buf);
1256+
pg_log_warning_detail("%s", buf);
12571257
}
12581258

12591259
if (nLoop > 1)

0 commit comments

Comments
 (0)