5 Ways to Enable Vertical Output in psql

When we use psql to write SQL queries in PostgreSQL, we’ll usually see the results presented as a table, with columns displayed vertically and rows running horizontally. But it is possible to change this so that the columns are displayed horizontally and the rows run vertically.

This can be useful for when the number of columns causes the results to be wider than our psql display, and may cause the rows to wrap to the next line.

Here are five ways we can change the display to vertical output, otherwise known as expanded display.

Continue reading