Display select results vertically in psql, as is done by MySQL's G
在MySQL中,您可以使用
1 2 3 4 5 6 7 8  | SELECT * FROM foo \G *************** id: 1 bar: Hello *************** id: 2 bar: World  | 
如何使用psql为PostgreSQL做同样的事情?
您可以通过启用展开显示来完成此操作。
通过
1 2 3 4  | # \x Expanded display IS ON. # \x Expanded display IS off.  | 
启用时,结果以表格(垂直)形式显示:
1 2 3 4 5 6  | -[ RECORD 1 ] id | 1 bar | Hello -[ RECORD 2 ] id | 2 bar | World  | 
您可以通过使用
1  | SELECT * FROM foo \x\g\x  |