postgresql error while using column values in jsonb_set function

I am trying to update a field value in jsonb column with text value present in another column but getting some syntax errors; not getting any solution.

i am trying to swap values of OutgoingVertexid & IncomingVertexId in below JSONB


so used below code by putting all values OutgoingVertexid & IncomingVertexid value in temp table.

UPDATE temp_table 
        owner_property = CASE 
                            WHEN owner_outgoing_edge IS NOT NULL 
                                THEN jsonb_set(owner_property, '{OutgoingVertexid}', '""')
                                jsonb_set(owner_property, '{OutgoingVertexid}', ''||owner_incoming_edge::jsonb||'') 

but getting below error:

ERROR: invalid input syntax for type json LINE 7: … jsonb_set(owner_property, ‘{OutgoingVertexid}’, ”””||ow… ^ DETAIL: Token “‘” is invalid.


Thanks in Advance

Go to Source
Author: VBAGuy