build update
This commit is contained in:
parent
69dbc7742b
commit
cf06d241d7
@ -1,3 +1,22 @@
|
|||||||
|
UPDATE
|
||||||
|
tps.srce
|
||||||
|
SET
|
||||||
|
defn =
|
||||||
|
--delete "schemas" from existing json and tack on revamped layout
|
||||||
|
jsonb_pretty((defn - 'schemas')||
|
||||||
|
--rebuild the schemas key value from below
|
||||||
|
jsonb_build_object(
|
||||||
|
'schemas'
|
||||||
|
--aggregate all the new key values for a single soure
|
||||||
|
,jsonb_agg(
|
||||||
|
--combine a new key 'name' with the columns for that name
|
||||||
|
jsonb_build_object('name',k)||jsonb_build_object('columns',v)
|
||||||
|
)
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
|
---------------select statement test-----------------------
|
||||||
|
/*
|
||||||
SELECT
|
SELECT
|
||||||
srce
|
srce
|
||||||
,jsonb_pretty(defn)
|
,jsonb_pretty(defn)
|
||||||
@ -17,3 +36,4 @@ FROM
|
|||||||
GROUP BY
|
GROUP BY
|
||||||
srce
|
srce
|
||||||
,defn
|
,defn
|
||||||
|
*/
|
Loading…
Reference in New Issue
Block a user