Sep 16
I do a lot of development with PHP, and often I need to work directly with PostgreSQL and MySQL’s client consoles, for schema work or data manipulation.
On both database clients, you can see a result set on expanded or vertical display (the output formatted in rows instead of the usual columns) with the following methods:
PostgreSQL
Toggle expanded display entering \x directly on the client’s console (pgsql).
MySQL
Use \\G instead of ; to finish the query. Example:
Regular (column) output: SELECT * FROM contact_list ;
Expanded (row) output: SELECT * FROM contact_list \\G
Leave a Reply
You must be logged in to post a comment.