diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2023-06-04 11:22:05 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2023-06-04 11:22:05 -0400 |
commit | 751ba1a7c168b28a3cc43032e9a1cc996e004054 (patch) | |
tree | 2d1a984ce568f099ac64144178b1e89356ec4e71 /src | |
parent | 0d6fffb4f0b55357e68e8908acd9cf8dc4e178f2 (diff) | |
download | postgresql-751ba1a7c168b28a3cc43032e9a1cc996e004054.tar.gz postgresql-751ba1a7c168b28a3cc43032e9a1cc996e004054.zip |
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 9a374b77f got rid of most such abuses, but unaccountably
missed these.
Noted while studying a bug report from Sami Imseih.
Back-patch to v15 where 9a374b77f 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
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/pg_dump_sort.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c index 5de3241eb49..780ed4c6a6d 100644 --- a/src/bin/pg_dump/pg_dump_sort.c +++ b/src/bin/pg_dump/pg_dump_sort.c @@ -1233,9 +1233,9 @@ repairDependencyLoop(DumpableObject **loop, "there are circular foreign-key constraints among these tables:", nLoop)); for (i = 0; i < nLoop; i++) - pg_log_info(" %s", loop[i]->name); - pg_log_info("You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints."); - pg_log_info("Consider using a full dump instead of a --data-only dump to avoid this problem."); + pg_log_warning_detail("%s", loop[i]->name); + pg_log_warning_hint("You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints."); + pg_log_warning_hint("Consider using a full dump instead of a --data-only dump to avoid this problem."); if (nLoop > 1) removeObjectDependency(loop[0], loop[1]->dumpId); else /* must be a self-dependency */ @@ -1253,7 +1253,7 @@ repairDependencyLoop(DumpableObject **loop, char buf[1024]; describeDumpableObject(loop[i], buf, sizeof(buf)); - pg_log_info(" %s", buf); + pg_log_warning_detail("%s", buf); } if (nLoop > 1) |