mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
psql: Show all query results by default
Previously, psql printed only the last result if a command string returned multiple result sets. Now it prints all of them. The previous behavior can be obtained by setting the psql variable SHOW_ALL_RESULTS to off. Author: Fabien COELHO <coelho@cri.ensmp.fr> Reviewed-by: "Iwata, Aya" <iwata.aya@jp.fujitsu.com> Reviewed-by: Daniel Verite <daniel@manitou-mail.org> Reviewed-by: Peter Eisentraut <peter.eisentraut@2ndquadrant.com> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-by: vignesh C <vignesh21@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/alpine.DEB.2.21.1904132231510.8961@lancre
This commit is contained in:
@ -50,8 +50,28 @@ BEGIN \;
|
||||
SELECT 2.0 AS "float" \;
|
||||
SELECT 'world' AS "text" \;
|
||||
COMMIT;
|
||||
float
|
||||
-------
|
||||
2.0
|
||||
(1 row)
|
||||
|
||||
text
|
||||
-------
|
||||
world
|
||||
(1 row)
|
||||
|
||||
-- compound with empty statements and spurious leading spacing
|
||||
\;\; SELECT 3 + 3 \;\;\; SELECT ' ' || ' !' \;\; SELECT 1 + 4 \;;
|
||||
?column?
|
||||
----------
|
||||
6
|
||||
(1 row)
|
||||
|
||||
?column?
|
||||
----------
|
||||
!
|
||||
(1 row)
|
||||
|
||||
?column?
|
||||
----------
|
||||
5
|
||||
@ -61,6 +81,11 @@ COMMIT;
|
||||
SELECT 1 + 1 + 1 AS "add" \gset
|
||||
SELECT :add + 1 + 1 AS "add" \;
|
||||
SELECT :add + 1 + 1 AS "add" \gset
|
||||
add
|
||||
-----
|
||||
5
|
||||
(1 row)
|
||||
|
||||
-- set operator
|
||||
SELECT 1 AS i UNION SELECT 2 ORDER BY i;
|
||||
i
|
||||
|
Reference in New Issue
Block a user