From 95d2af1646080474ad3e1f1303e68dd5799f9cad Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sat, 12 Nov 2011 17:03:10 +0200 Subject: Add psql expanded auto mode This adds the "auto" option to the \x command, which switches to the expanded mode when the normal output would be wider than the screen. reviewed by Noah Misch --- doc/src/sgml/ref/psql-ref.sgml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index d6941e0bd33..01f57c4eeb9 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1860,7 +1860,8 @@ lo_import 152801 Sets the target width for the wrapped format, and also the width limit for determining whether output is wide enough to - require the pager. + require the pager or switch to the vertical display in expanded auto + mode. Zero (the default) causes the target width to be controlled by the environment variable COLUMNS, or the detected screen width if COLUMNS is not set. @@ -1876,15 +1877,19 @@ lo_import 152801 expanded (or x) - If value is specified - it must be either on or off - which will enable or disable expanded mode. If value is omitted the command toggles - between regular and expanded mode. - When expanded mode is enabled, query results - are displayed in two columns, with the 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 horizontal mode. + If value is specified it + must be either on or off, which + will enable or disable expanded mode, or auto. + If value is omitted the + command toggles between the on and off settings. When expanded mode + is enabled, query results are displayed in two columns, with the + 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 horizontal 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 + effective in the aligned and wrapped formats. In other formats, it + always behaves as if the expanded mode is off. @@ -2326,10 +2331,10 @@ lo_import 152801 - \x + \x [ on | off | auto ] - Toggles expanded table formatting mode. As such it is equivalent to + Sets or toggles expanded table formatting mode. As such it is equivalent to \pset expanded. @@ -3197,7 +3202,8 @@ $endif If \pset columns is zero, controls the width for the wrapped format and width for determining - if wide output requires the pager. + if wide output requires the pager or should be switched to the + vertical format in expanded auto mode. -- cgit v1.2.3