2017-10-25 00:42:22 -04:00
|
|
|
WITH
|
|
|
|
ext AS (
|
|
|
|
SELECT
|
|
|
|
srce
|
|
|
|
,defn->'unique_constraint'->>'fields'
|
|
|
|
,ARRAY(SELECT ae.e::text[] FROM jsonb_array_elements_text(defn->'unique_constraint'->'fields') ae(e)) txa
|
|
|
|
FROM
|
|
|
|
tps.srce
|
|
|
|
)
|
2017-10-25 00:47:26 -04:00
|
|
|
|
|
|
|
|
2017-10-25 00:42:22 -04:00
|
|
|
SELECT
|
2017-10-25 00:47:26 -04:00
|
|
|
t.srce
|
|
|
|
,jsonb_pretty(t.rec)
|
|
|
|
,jsonb_pretty(public.jsonb_extract(rec,txa))
|
2017-10-25 00:42:22 -04:00
|
|
|
FROM
|
2017-10-25 00:47:26 -04:00
|
|
|
tps.trans t
|
2017-10-25 00:42:22 -04:00
|
|
|
INNER JOIN ext ON
|
2017-10-25 00:47:26 -04:00
|
|
|
t.srce = ext.srce
|