Posts filed under 'Databases'

Showing MySQL and PostgreSQL’s results on expanded or vertical display

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

Add comment September 16th, 2006


Posts by Month

Posts by Category