-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: add \x slash command as alias for \set display_format=records #56706
Copy link
Copy link
Closed
Labels
O-communityOriginated from the communityOriginated from the community
Description
psql has a \x [on|off|auto] slash command to switch between table and record output:
test=# SELECT 1, 2, 3;
?column? | ?column? | ?column?
----------+----------+----------
1 | 2 | 3
(1 row)
test=# \x
Expanded display is on.
test=# SELECT 1, 2, 3;
-[ RECORD 1 ]
?column? | 1
?column? | 2
?column? | 3
cockroach sql supports the same output formats, but uses \set display_format=records instead:
root@:26257/defaultdb> SELECT 1, 2, 3;
?column? | ?column? | ?column?
-----------+----------+-----------
1 | 2 | 3
(1 row)
Time: 0ms total (execution 0ms / network 0ms)
root@:26257/defaultdb> \set display_format=records
root@:26257/defaultdb> SELECT 1, 2, 3;
-[ RECORD 1 ]
?column? | 1
?column? | 2
?column? | 3
Time: 0ms total (execution 0ms / network 0ms)
I propose adding \x as an alias for toggling between records and table, and supporting the optional on and off parameters (but not auto in the first iteration).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
O-communityOriginated from the communityOriginated from the community