diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-12-01 11:07:29 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-12-01 11:07:29 -0500 |
commit | 6fe8ca0a2f8ac5ce2656addb0f6741b5315a8a23 (patch) | |
tree | 222ae4194885248edacf8c13e2c2dc1a2e67769d | |
parent | 4122ebcb1056655f23193e4632dccce68c524e43 (diff) | |
download | postgresql-6fe8ca0a2f8ac5ce2656addb0f6741b5315a8a23.tar.gz postgresql-6fe8ca0a2f8ac5ce2656addb0f6741b5315a8a23.zip |
Further adjustment to psql's print_aligned_vertical() function.
We should ignore output_columns unless it's greater than zero.
A zero means we couldn't get any information from ioctl(TIOCGWINSZ);
in that case the expected behavior is to print the data at native width,
not to wrap it at the smallest possible value. print_aligned_text()
gets this consideration right, but print_aligned_vertical() lost track
of this detail somewhere along the line.
-rw-r--r-- | src/bin/psql/print.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c index b53e81be379..e103d5b0841 100644 --- a/src/bin/psql/print.c +++ b/src/bin/psql/print.c @@ -1424,7 +1424,8 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout) if (rwidth > min_width) min_width = rwidth; - if (width < min_width || output_columns < min_width) + if (width < min_width || + (output_columns > 0 && output_columns < min_width)) { /* Set data width to match min_width */ newdwidth = min_width - hwidth - swidth; |