Re: JSON output from psql

2020-05-13 Thread Gurjeet Singh
On Wed, May 13, 2020 at 2:01 PM Chapman Flack wrote: > > Seems like a lot of work just to get json-shaped query results from psql, +1. If we look at the amount of work needed for the hybrid approach you describe, compared to running CSV result through something like csv2json, there's a 100% chanc

Re: JSON output from psql

2020-05-13 Thread Chapman Flack
On 05/13/20 16:16, Gurjeet Singh wrote: > On Wed, May 13, 2020 at 1:14 PM Gurjeet Singh wrote: >> >> Arguably, delivering JSON (with its repeating attribute names in every >> element of the array, dquotes and commas) is more network intensive >> than converting the resultset to JSON on [client] si

Re: JSON output from psql

2020-05-13 Thread Gurjeet Singh
On Wed, May 13, 2020 at 1:14 PM Gurjeet Singh wrote: > > Arguably, delivering JSON (with its repeating attribute names in every > element of the array, dquotes and commas) is more network intensive > than converting the resultset to JSON on network side. s/network side/client side/ Best regards,

Re: JSON output from psql

2020-05-13 Thread Gurjeet Singh
On Wed, May 13, 2020 at 12:50 PM Robert Haas wrote: > > On Mon, May 11, 2020 at 4:42 PM Gurjeet Singh wrote: > > That's a good point! It might still be desirable, perhaps for performance > > trade-off of JSON conversion on the client-side instead of on the > > server-side. > > If there's a perf

Re: JSON output from psql

2020-05-13 Thread Robert Haas
On Mon, May 11, 2020 at 4:42 PM Gurjeet Singh wrote: > That's a good point! It might still be desirable, perhaps for performance > trade-off of JSON conversion on the client-side instead of on the server-side. If there's a performance problem with the server's code here, we should probably try t

Re: JSON output from psql

2020-05-11 Thread Gurjeet Singh
On Mon, May 11, 2020 at 1:24 PM Robert Haas wrote: > On Fri, May 8, 2020 at 7:32 PM Gurjeet Singh wrote: > > 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

Re: JSON output from psql

2020-05-11 Thread Robert Haas
On Fri, May 8, 2020 at 7:32 PM Gurjeet Singh wrote: > 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: > > [ > {"rel

Re: JSON output from psql

2020-05-08 Thread Gurjeet Singh
On Fri, May 8, 2020 at 12:10 PM Pavel Stehule wrote: > > > pá 8. 5. 2020 v 21:08 odesílatel Gurjeet Singh napsal: > >> >> On Fri, May 8, 2020 at 12:01 PM Pavel Stehule >> wrote: >> >>> Hi >>> >>> pá 8. 5. 2020 v 20:18 odesílatel Gurjeet Singh >>> napsal: >>> psql currently supports HT

Re: JSON output from psql

2020-05-08 Thread Pavel Stehule
pá 8. 5. 2020 v 21:08 odesílatel Gurjeet Singh napsal: > > On Fri, May 8, 2020 at 12:01 PM Pavel Stehule > wrote: > >> Hi >> >> pá 8. 5. 2020 v 20:18 odesílatel Gurjeet Singh napsal: >> >>> psql currently supports HTML, CSV, etc output formats. I was >>> wondering if supporting JSON format

Re: JSON output from psql

2020-05-08 Thread Gurjeet Singh
On Fri, May 8, 2020 at 12:01 PM Pavel Stehule wrote: > Hi > > pá 8. 5. 2020 v 20:18 odesílatel Gurjeet Singh 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 feat

Re: JSON output from psql

2020-05-08 Thread Pavel Stehule
Hi pá 8. 5. 2020 v 20:18 odesílatel Gurjeet Singh 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

JSON output from psql

2020-05-08 Thread Gurjeet Singh
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. Best regards, -- Gurjeet S