Commit d7ec833
committed
Fix printing last progress report line in client programs.
A number of client programs have a "--progress" option that when printing
to a TTY, updates the current line by printing a '\r' and overwriting it.
After the last line, '\n' needs to be printed to move the cursor to the
next line. pg_basebackup and pgbench got this right, but pg_rewind and
pg_checksums were slightly wrong. pg_rewind printed the newline to stdout
instead of stderr, and pg_checksums printed the newline even when not
printing to a TTY. Fix them, and also add a 'finished' argument to
pg_basebackup's progress_report() function, to keep it consistent with
the other programs.
Backpatch to v12. pg_rewind's newline was broken with the logging changes
in commit cc8d415 in v12, and pg_checksums was introduced in v12.
Discussion: https://www.postgresql.org/message-id/82b539e5-ae33-34b0-1aee-22b3379fd3eb@iki.fi1 parent b4f1639 commit d7ec833
File tree
4 files changed
+41
-35
lines changed- src/bin
- pg_basebackup
- pg_checksums
- pg_rewind
4 files changed
+41
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| |||
765 | 766 | | |
766 | 767 | | |
767 | 768 | | |
768 | | - | |
769 | | - | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
770 | 774 | | |
771 | 775 | | |
772 | | - | |
| 776 | + | |
| 777 | + | |
773 | 778 | | |
774 | 779 | | |
775 | 780 | | |
| |||
780 | 785 | | |
781 | 786 | | |
782 | 787 | | |
783 | | - | |
| 788 | + | |
784 | 789 | | |
785 | 790 | | |
786 | 791 | | |
| |||
851 | 856 | | |
852 | 857 | | |
853 | 858 | | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
858 | 864 | | |
859 | 865 | | |
860 | 866 | | |
| |||
1277 | 1283 | | |
1278 | 1284 | | |
1279 | 1285 | | |
1280 | | - | |
| 1286 | + | |
1281 | 1287 | | |
1282 | 1288 | | |
1283 | 1289 | | |
| |||
1470 | 1476 | | |
1471 | 1477 | | |
1472 | 1478 | | |
1473 | | - | |
| 1479 | + | |
1474 | 1480 | | |
1475 | 1481 | | |
1476 | 1482 | | |
| |||
1528 | 1534 | | |
1529 | 1535 | | |
1530 | 1536 | | |
1531 | | - | |
| 1537 | + | |
1532 | 1538 | | |
1533 | 1539 | | |
1534 | 1540 | | |
| |||
1709 | 1715 | | |
1710 | 1716 | | |
1711 | 1717 | | |
1712 | | - | |
| 1718 | + | |
1713 | 1719 | | |
1714 | 1720 | | |
1715 | 1721 | | |
| |||
2027 | 2033 | | |
2028 | 2034 | | |
2029 | 2035 | | |
2030 | | - | |
2031 | | - | |
2032 | | - | |
2033 | | - | |
2034 | | - | |
| 2036 | + | |
2035 | 2037 | | |
2036 | 2038 | | |
2037 | 2039 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
166 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
| |||
624 | 627 | | |
625 | 628 | | |
626 | 629 | | |
627 | | - | |
628 | 630 | | |
629 | | - | |
630 | | - | |
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
426 | 425 | | |
427 | 426 | | |
428 | 427 | | |
| |||
519 | 518 | | |
520 | 519 | | |
521 | 520 | | |
522 | | - | |
523 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
524 | 526 | | |
525 | 527 | | |
526 | | - | |
| 528 | + | |
527 | 529 | | |
528 | 530 | | |
529 | 531 | | |
| |||
535 | 537 | | |
536 | 538 | | |
537 | 539 | | |
538 | | - | |
| 540 | + | |
539 | 541 | | |
540 | 542 | | |
541 | 543 | | |
| |||
565 | 567 | | |
566 | 568 | | |
567 | 569 | | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
572 | 576 | | |
573 | 577 | | |
574 | 578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
0 commit comments