mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
psql: Don't automatically use expanded format when there's 1 column.
Andreas Karlsson and Robert Haas
This commit is contained in:
@ -816,9 +816,11 @@ print_aligned_text(const printTableContent *cont, FILE *fout, bool is_pager)
|
||||
|
||||
/*
|
||||
* If in expanded auto mode, we have now calculated the expected width, so
|
||||
* we can now escape to vertical mode if necessary.
|
||||
* we can now escape to vertical mode if necessary. If the output has
|
||||
* only one column, the expanded format would be wider than the regular
|
||||
* format, so don't use it in that case.
|
||||
*/
|
||||
if (cont->opt->expanded == 2 && output_columns > 0 &&
|
||||
if (cont->opt->expanded == 2 && output_columns > 0 && cont->ncolumns > 1 &&
|
||||
(output_columns < total_header_width || output_columns < width_total))
|
||||
{
|
||||
print_aligned_vertical(cont, fout, is_pager);
|
||||
|
Reference in New Issue
Block a user