mirror of
https://github.com/postgres/postgres.git
synced 2025-11-03 09:13:20 +03:00
psql: Add option to use expanded mode to all list commands.
This allows "x" to be appended to any psql list-like meta-command, forcing its output to be displayed in expanded mode. This improves readability in cases where the output is very wide. For example, "\dfx+" (or equivalently "\df+x") will produce a list of functions, with additional details, in expanded mode. This works with all \d* meta-commands, plus \l, \z, and \lo_list, with the one exception that the expanded mode option "x" cannot be appended to "\d" by itself, since "\dx" already means something else. Dean Rasheed, reviewed by Greg Sabino Mullane. Discussion: https://postgr.es/m/CAEZATCVXJk3KsmCncf7PAVbxdDAUDm3QzDgGT7mBYySWikuOYw@mail.gmail.com
This commit is contained in:
@@ -498,6 +498,7 @@ create table psql_serial_tab (id serial);
|
||||
\d psql_serial_tab_id_seq
|
||||
\pset tuples_only true
|
||||
\df exp
|
||||
\dfx exp
|
||||
\pset tuples_only false
|
||||
\pset expanded on
|
||||
\d psql_serial_tab_id_seq
|
||||
@@ -560,6 +561,9 @@ CREATE MATERIALIZED VIEW mat_view_heap_psql USING heap_psql AS SELECT f1 from tb
|
||||
\dv+
|
||||
\set HIDE_TABLEAM on
|
||||
\d+
|
||||
-- \d with 'x' enables expanded mode, but only without a pattern
|
||||
\d+x tbl_heap
|
||||
\d+x
|
||||
RESET ROLE;
|
||||
RESET search_path;
|
||||
DROP SCHEMA tableam_display CASCADE;
|
||||
@@ -1309,6 +1313,7 @@ drop role regress_partitioning_role;
|
||||
\dAo+ btree array_ops|float_ops
|
||||
\dAo * pg_catalog.jsonb_path_ops
|
||||
\dAp+ btree float_ops
|
||||
\dApx+ btree time_ops
|
||||
\dAp * pg_catalog.uuid_ops
|
||||
|
||||
-- check \dconfig
|
||||
@@ -1927,5 +1932,6 @@ ROLLBACK;
|
||||
CREATE TABLE defprivs (a int);
|
||||
\pset null '(default)'
|
||||
\z defprivs
|
||||
\zx defprivs
|
||||
\pset null ''
|
||||
DROP TABLE defprivs;
|
||||
|
||||
Reference in New Issue
Block a user