jsonb_pretty()

A function for converting jsonb to formatted text

jsonb_pretty() is a system function for converting jsonb values to formatted and indented text.

jsonb_pretty() was added in PostgreSQL 9.5.

Usage

jsonb_pretty ( jsonb ) → text

Change history

Examples

Basic usage example for jsonb_pretty():

postgres=# SELECT jsonb_pretty('{"a":"foo", "b":{"bar":"baz"}}');
     jsonb_pretty
----------------------
 {                   +
     "a": "foo",     +
     "b": {          +
         "bar": "baz"+
     }               +
 }
(1 row)

Categories

JSON, System function