Re: psql JSON output format - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: psql JSON output format
Date
Msg-id ZYBf7fD8vTb7DHZ2@msg.df7cb.de
Whole thread Raw
In response to psql JSON output format  (Christoph Berg <myon@debian.org>)
List pgsql-hackers
Re: To PostgreSQL Hackers
> On the command line, the format is selected by `psql --json` and `psql -J`.

Among other uses, it enables easy post-processing of psql output using `jq`:

$ psql -lJ | jq
[
  {
    "Name": "myon",
    "Owner": "myon",
    "Encoding": "UTF8",
    "Locale Provider": "libc",
    "Collate": "de_DE.utf8",
    "Ctype": "de_DE.utf8",
    "ICU Locale": null,
    "ICU Rules": null,
    "Access privileges": null
  },
...
]

Christoph



pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: psql JSON output format
Next
From: Matt Skelley
Date:
Subject: Re: A wrong comment about search_indexed_tlist_for_var