column name on the left and the data on the right. This mode is
useful if the data wouldn't fit on the screen in the
normal <quote>horizontal</quote> mode. In the auto setting, the
- expanded mode is used whenever the query output is wider than the
- screen, otherwise the regular mode is used. The auto setting is only
+ expanded mode is used whenever the query output has more than one
+ column and is wider than the screen; otherwise, the regular mode is
+ used. The auto setting is only
effective in the aligned and wrapped formats. In other formats, it
always behaves as if the expanded mode is off.
</para>
/*
* 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);