json - function json_each does not exist -
i getting error json_each function not exist. using postgresql 9.3. dont know whats wrong. please assist me here.
select * json_each(( select ed.result externaldata ed inner join application on a.id = ed.application_id )) limit 1;
the inside looped query returns :
" { "respuestasvc89":{ "header":{ "transaccion":"expe", "servicio":"92", "codigoretorno":"00", "numerooperacion":"201409147001616", "codigomodelo":"13852901" }, "meta":{ "billa":"expe", "numo":"52", "retorno":"01", "operacion":"2014091470", } } }"
so should work somehow not work
exact error message :
error: function json_each(text) not exist line 2: json_each(( ^ hint: no function matches given name , argument types. might need add explicit type casts. ********** error ********** error: function json_each(text) not exist sql state: 42883 hint: no function matches given name , argument types. might need add explicit type casts. character: 15
the error message states no json_each(text) function exists, know json_each(json) function exists. key casting ed.result json data type so:
select * json_each(( select ed.result::json externaldata ed inner join application on a.id = ed.application_id )) limit 1;
you might consider making ed.result column of type json (in actual table) instead of type text if data valid json. when 9.4 comes out, you'll want use jsonb data type take advantage of performance , space benefits come datatype.
Comments
Post a Comment