PostgrelSQL 类似 MySQL \G 扩展显示结果
PostgreSQL About 1,471 wordsMySQL \G
在命令行中,如果一行数据较多,会被换行显示,到时列名对不齐,看起来比较吃力,使用MySQL
可以在SQL
最后加上\G
倒转显示。
select * from user \G
PostgreSQL \x
在PostgreSQL
中,也有类似的功能。使用\x
开启扩展显示,再次输入即关闭。
z-blog=# \x
扩展显示已打开
z-blog=# select * from pg_stat_activity;
-[ RECORD 1 ]----+---------------------------------------------------------------------------------------------------------------------------------------------------------------
datid |
datname |
pid | 16936
usesysid |
usename |
application_name |
client_addr |
client_hostname |
client_port |
backend_start | 2020-02-16 21:14:56.11709+08
xact_start |
query_start |
state_change |
wait_event_type | Activity
wait_event | AutoVacuumMain
state |
backend_xid |
backend_xmin |
query |
backend_type | autovacuum launcher
-[ RECORD 2 ]----+---------------------------------------------------------------------------------------------------------------------------------------------------------------
datid |
datname |
pid | 5144
usesysid | 10
usename | thunk
application_name |
client_addr |
client_hostname |
client_port |
backend_start | 2020-02-16 21:14:56.13742+08
xact_start |
query_start |
state_change |
wait_event_type | Activity
wait_event | LogicalLauncherMain
state |
backend_xid |
backend_xmin |
query |
-- More --
Views: 3,623 · Posted: 2020-02-25
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓
Loading...