I have a json poll_result
{"total_votes":1,"yes":1,"no":0}
and I have a variable that has the key
vote_to = _poll_response::json#>>'{vote}';
and that returns the "yes".
Now I want to access poll_result json based on the vote_to variable's value, so I am trying
raise notice '%',poll_result::json#>>'{||vote_to||}';
but this is printing <NULL>. Even I have tried like
raise notice '%,%',poll_result,poll_result::json#>>'{''||vote_to||''}';
but the result is same <NULL>.
Please help!!!