Re: Table column vales to JSON object keys? - Mailing list pgsql-admin

From David G. Johnston
Subject Re: Table column vales to JSON object keys?
Date
Msg-id CAKFQuwYTvbo4AqgY62xLdU=g8FaLFA5Ggr9ZAmtHTCPZTvp=rQ@mail.gmail.com
Whole thread Raw
In response to Table column vales to JSON object keys?  (Wells Oliver <wells.oliver@gmail.com>)
Responses Re: Table column vales to JSON object keys?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-admin
On Thursday, February 11, 2021, Wells Oliver <wells.oliver@gmail.com> wrote:
Trying to go from a table like:

 g  | e |  angle | path
----+---+--------+----------------------
 g1 | e1 | a1    | http://foo.com/a.mp4
 g1 | e1 | a2    | http://foo.com/b.mp4
 g1 | e1 | a3    | http://foo.com/c.mp4


To a table like this, with a column value per angle as a key.

 g  | e |  obj
----+---+---------------------------------------------------------------------------------------------
 g1 | e1 | {"a1": "http://foo.com/a.mp4", "a2": "http://foo.com/b.mp4", "a3": "http://foo.com/c.mp4"}

 
Can't quite get there.



How far can you get?

David J.

pgsql-admin by date:

Previous
From: Wells Oliver
Date:
Subject: Table column vales to JSON object keys?
Next
From: Tom Lane
Date:
Subject: Re: Table column vales to JSON object keys?