Display select results vertically in psql, as is done by MySQL's \G
问题 In MySQL, you can terminate a select query with \G (as opposed to \g ) to display the results vertically: select * from foo \G *************** id: 1 bar: Hello *************** id: 2 bar: World How can one do the same thing for PostgreSQL using psql? 回答1: You can do this by enabling Expanded display . Toggle this setting via \x . For example: # \x Expanded display is on. # \x Expanded display is off. When on, results are shown in tabular (vertical) form: -[ RECORD 1 ] id | 1 bar | Hello -[