I have JSON data stored as regular strings in my Postgres tables. When I select them in the psql client, I want these strings to be pretty-printed so that I can see the data more easily.
Can I do this without running the output through an external program?
You can use the function
jsonb_pretty--just cast the data to typejsonbfirst:Output (I started the client with
psql -Ato strip some extraneous output):jsonb_prettywas added in Postgres 9.5