question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Emulate `jsonb_pretty`

See original GitHub issue

Would it be possible to implement jsonb_pretty-like functionality for pretty printing JSON(B) fields on postgres < 9.5?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:5
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
tsrotencommented, Sep 23, 2017

Just a note that tabulate does support multi-line text now (in its master branch, yet to be released).

3reactions
amjithcommented, Oct 17, 2019

This is now working. Please upgrade pgcli (pip install -U pgcli).

SELECT jsonb_pretty(EmployeeDetails) AS EmployeeDetails FROM tbl_TestJSON;
+-----------------------------------+
| employeedetails                   |
|-----------------------------------|
| {                                 |
|     "employees": [                |
|         {                         |
|             "lastName": "Patel",  |
|             "firstName": "Anvesh" |
|         }                         |
|     ]                             |
| }                                 |
| {                                 |
|     "employees": [                |
|         {                         |
|             "lastName": "Shah",   |
|             "firstName": "Nancy"  |
|         }                         |
|     ]                             |
| }                                 |
+-----------------------------------+
SELECT 2
Time: 0.092s

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simulator - JSON Formatter
Python Pretty Print JSON · Read JSON File Using Python · Validate JSON using PHP · Python Load Json From File. Online JSON...
Read more >
How to Pretty Print JSON File in Linux Terminal - It's FOSS
Pretty print JSON with jq command in Linux. jq is a command line JSON processor. You can use it to slice, filter, map...
Read more >
Commandline JSON Pretty Print everywhere - Coderwall
You can pretty print (and validate) json on nearly every *nix-like (unix, linux, osx,…) system, since most of them have Python (2.6+ ...
Read more >
Reformatting a string to simulate a json using python regex
What I want to do is essentially reformat a string and make it pass the jsonschema validate function. Simple enough at face value....
Read more >
JSON Generator for Mock API Data - Stoplight Blog
Create random JSON and host it on a mock server. ... To emulate our earlier example, the first thing we need to do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found