Re: JSON output from psql
От | Gurjeet Singh |
---|---|
Тема | Re: JSON output from psql |
Дата | |
Msg-id | CABwTF4VqDON6HcVHPY=Dp8gV5mMN5UG71r=ghuj75Gj8kNpyuQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: JSON output from psql (Pavel Stehule <pavel.stehule@gmail.com>) |
Ответы |
Re: JSON output from psql
|
Список | pgsql-hackers |
On Fri, May 8, 2020 at 12:10 PM Pavel Stehule <pavel.stehule@gmail.com> wrote:
pá 8. 5. 2020 v 21:08 odesílatel Gurjeet Singh <gurjeet@singh.im> napsal:On Fri, May 8, 2020 at 12:01 PM Pavel Stehule <pavel.stehule@gmail.com> wrote:Hipá 8. 5. 2020 v 20:18 odesílatel Gurjeet Singh <gurjeet@singh.im> napsal:psql currently supports HTML, CSV, etc output formats. I was wondering if supporting JSON format was requested or discussed in past. If there's desire for this feature, perhaps we can add it to the TODO list on wiki so someone can pick it up and work on it in future.is there some standardised format for output table?I see "-T, --table-attr=TEXT" option in `psql --help` output, presumably that's to create HTML tables.I though for JSON format. This format is too generic.
I think I misunderstood your question earlier.
There's no standard format that comes to mind, but perhaps an output format similar to that of (array of row_to_json()) would be desirable. For example, `select relname, relnamespace from pg_class;` would emit the following:
[
{"relname": "pgclass", "relnamespace": 11},
{"relname": "pg_statistic", "relnamespace": 11},
]
Best regards,
--
Gurjeet Singh http://gurjeet.singh.im/
В списке pgsql-hackers по дате отправления: