暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

磐维数据库查询结果按列展示

原创 PanWeiDB_DBA 2024-07-01
90

磐维数据库中如何实现查询结果按列展示?类似与MySQL数据库的\G效果,可以使用\x命令,以扩展方式显示查询结果。示例如下:

postgres=# \x
Expanded display is on.
postgres=# select * from pg_user;
-[ RECORD 1 ]----+-------------
usename | dtp
usesysid | 20720
usecreatedb | 0
usesuper | 0
usecatupd | 0
userepl | 0
passwd | ********
valbegin |
valuntil |
respool | default_pool
parent | 0
spacelimit |
useconfig |
nodegroup |
tempspacelimit |
spillspacelimit |
usemonitoradmin | 0
useoperatoradmin | 0
usepolicyadmin | 0
-[ RECORD 2 ]----+-------------
usename | sdr_repl
usesysid | 20713
usecreatedb | 0
usesuper | 0
usecatupd | 0
userepl | 1
passwd | ********
valbegin |
valuntil |
respool | default_pool
parent | 0
spacelimit |
useconfig |
nodegroup |
tempspacelimit |
spillspacelimit |
usemonitoradmin | 0
useoperatoradmin | 0
usepolicyadmin | 0

再执行\x命令恢复默认显示方法。

postgres=# \x
Expanded display is off.

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论