1
I need to migrate from sql server 2017 to the postgresql,but I never used postgresql and I’m having a hard time. I need to convert a array json for values that are inserted in the table.
In the sql server I used to use a insert
with select openjson
and the clause with
to specify what I would take from json.
valores json := '[
{"tipo":"a","valor:"10.89}
{"tipo":"b","valor:"10.88}
{"tipo":"c","valor:"10.87}
{"tipo":"d","valor:"10.86}
]';
insert into dbo.testedojson(valor,tipo)
select *
from json_populate_record(NULL::dbo.testedojson,valores);
I took this example from internet to take a test,dbo.testedojson
is the table that will receive the values but there is a syntax error that does not find.