title: Text and jsonb concatenation in a single postgresql query
body: <p>How can I concatenate a string inside of a concatenated jsonb object in postgresql? In other words, I am using the JSONb concatenate operator as well as the text concatenate operator in the same query and running into trouble.</p>
  <p>Or... if there is a totally different query I should be executing, I'd appreciate hearing suggestions. The goal is to update a row containing a jsonb column. We don't want to overwrite existing key value pairs in the jsonb column that are not provided in the query and we also want to update multiple rows at once.</p>
  <p>My query:</p>
  <pre><code>update contacts as c set data = data || '{&quot;geomatch&quot;: &quot;MATCH&quot;,&quot;latitude&quot;:'||v.latitude||'}'
  from (values (16247746,40.814140),
        (16247747,20.900840),
        (16247748,20.890570)) as v(contact_id,latitude) where c.contact_id = v.contact_id
  </code></pre>
  <p>The Error:</p>
  <pre><code> ERROR:  invalid input syntax for type json
      LINE 85: update contacts as c set data = data || '{&quot;geomatch&quot;: &quot;MATCH...
                                                       ^
      DETAIL:  The input string ended unexpectedly.
      CONTEXT:  JSON data, line 1: {&quot;geomatch&quot;: &quot;MATCH&quot;,&quot;latitude&quot;:
      SQL state: 22P02
      Character: 4573
  </code></pre>