[SQL] autogenerated json path
От | Viktor Bojović |
---|---|
Тема | [SQL] autogenerated json path |
Дата | |
Msg-id | CAJu1cLZLKx495vTfnah5iWSaReeSZ=XGrrzRaH0D42yvF=mwUA@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: [SQL] autogenerated json path
|
Список | pgsql-sql |
Hi,
--
im first time using json data type and i want to autogenerate it, because im creating crawler which uses postgresql.
This is static example for one site where path should be automatically generate
SELECT
file_name
,json_data#>>'{1,children,1,children,5,children,3,children,0,children,22,children,0,children,1,children,0,content}'
from src_data
where file_name ~ 'monitor.hr';
in case that i want to add into table another sites and their paths, i would like to write query which automaticaly changes paths.
SELECT
file_name
,json_data#>>'{''||r.json_path ||''}'
,r.json_path
from src_data d,rules r
where file_name like r.file_name_prefix||'%';
is there any way to write this without writing functions which would slow process?
---------------------------------------
Viktor Bojović
Viktor Bojović
В списке pgsql-sql по дате отправления: