diff options
| author | Stephen Frost <sfrost@snowman.net> | 2017-03-07 09:31:52 -0500 |
|---|---|---|
| committer | Stephen Frost <sfrost@snowman.net> | 2017-03-07 09:31:52 -0500 |
| commit | b2678efd43f17db7dfa04e0ca076ea01275cd9bc (patch) | |
| tree | 286017423ffd724b3759be1141dc67df45484eae /src/test/regress/expected/psql.out | |
| parent | 9a83d56b38c870ce47b7651385ff2add583bf136 (diff) | |
| download | postgresql-b2678efd43f17db7dfa04e0ca076ea01275cd9bc.tar.gz | |
psql: Add \gx command
It can often be useful to use expanded mode output (\x) for just a
single query. Introduce a \gx which acts exactly like \g except that it
will force expanded output mode for that one \gx call. This is simpler
than having to use \x as a toggle and also means that the user doesn't
have to worry about the current state of the expanded variable, or
resetting it later, to ensure a given query is always returned in
expanded mode.
Primairly Christoph's patch, though I did tweak the documentation and help
text a bit, and re-indented the tab completion section.
Author: Christoph Berg
Reviewed By: Daniel Verite
Discussion: https://postgr.es/m/20170127132737.6skslelaf4txs6iw%40msg.credativ.de
Diffstat (limited to 'src/test/regress/expected/psql.out')
| -rw-r--r-- | src/test/regress/expected/psql.out | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/regress/expected/psql.out b/src/test/regress/expected/psql.out index 026a4f0c83..eb7f197b12 100644 --- a/src/test/regress/expected/psql.out +++ b/src/test/regress/expected/psql.out @@ -28,6 +28,29 @@ on \unset ON_ERROR_ROLLBACK \echo :ON_ERROR_ROLLBACK off +-- \g and \gx +SELECT 1 as one, 2 as two \g + one | two +-----+----- + 1 | 2 +(1 row) + +\gx +-[ RECORD 1 ] +one | 1 +two | 2 + +SELECT 3 as three, 4 as four \gx +-[ RECORD 1 ] +three | 3 +four | 4 + +\g + three | four +-------+------ + 3 | 4 +(1 row) + -- \gset select 10 as test01, 20 as test02, 'Hello' as test03 \gset pref01_ \echo :pref01_test01 :pref01_test02 :pref01_test03 |
