{"id":778,"date":"2021-06-20T17:32:48","date_gmt":"2021-06-20T11:32:48","guid":{"rendered":"https:\/\/mellowhost.com\/blog\/?p=778"},"modified":"2021-06-20T17:32:48","modified_gmt":"2021-06-20T11:32:48","slug":"how-to-display-select-result-vertically-in-postgres-psql-console","status":"publish","type":"post","link":"https:\/\/mellowhost.com\/blog\/how-to-display-select-result-vertically-in-postgres-psql-console.html","title":{"rendered":"How to Display Select Result Vertically in Postgres psql Console"},"content":{"rendered":"\n<p>Mysql has a pretty cool feature with \\G, that sets the mysql query result in vertical mode. If you have a table with a lot of column, you will face difficulty to display them in horizontal mode. Hence, you want to see the result vertically. <\/p>\n\n\n\n<p>For Postgres, this is called &#8216;expanded display&#8217;. To set the expanded display on or off, you need to use the following command in psql console:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">my_prod=# \\x\nExpanded display is on.\nmy_prod=# \\x\nExpanded display is off.\nmy_prod=#\n<\/pre>\n\n\n\n<p>If your expanded display is on, then \\x will set this to off, else it would set the display to on. If you set the expanded display to on, this would show the column and value in a vertical key value pair style display, which is much easier to understand.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mysql has a pretty cool feature with \\G, that sets the mysql query result in vertical mode. If you have a table with a lot of column, you will face difficulty to display them in horizontal mode. Hence, you want to see the result vertically. For Postgres, this is called &#8216;expanded display&#8217;. To set the &hellip; <a href=\"https:\/\/mellowhost.com\/blog\/how-to-display-select-result-vertically-in-postgres-psql-console.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Display Select Result Vertically in Postgres psql Console&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[412,523],"tags":[578,524,579,577],"_links":{"self":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/778"}],"collection":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/comments?post=778"}],"version-history":[{"count":1,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/778\/revisions"}],"predecessor-version":[{"id":779,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/778\/revisions\/779"}],"wp:attachment":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/media?parent=778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/categories?post=778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/tags?post=778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}