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!
|
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! | |||
|
feedback
|
|
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.
| |||
|
feedback
|
|
Actually, you can enable \G mysql style formatting on a per-query basis in psql by putting the following in ~/.psqlrc:
You can then use :G at the end of a query in the psql client the same as you would \G at the end of a query in the mysql client:
| |||
|
feedback
|
|
You can toggle psql into extended mode with \x before you run a command, but you can't do it on a command by command basis like you can in mysql. | |||
|
feedback
|