Mysql – Postgres equivalent to MySQL’s \G

MySQLpostgresql

Does anyone know if Postgres has a way to display query results "prettily", like how MySQL does when ending a query with \G on the command line? For instance, "select * from sometable\G" as opposed to "select * from sometable;"

Many thanks!

Best Answer

I'm not familiar enough with MySQL to know what the \G option does, but based on the documentation it looks like the psql \x option might do what you want.

It's a toggle, though, so you do it before you submit the query.

\x
select * from sometable;