title: insert jsonb data in postgresql, option array or objects, valid way
body: <p>I have this update, i've read postgresql documentation, but nothing clear about how to insert data, some tutorials options:</p>
  
  <pre><code>1.with '{}'
  2.with {}
  3.with '[]'  &lt;-- array of objects
  </code></pre>
  
  <p>and most dont' use '::jsonb' like is indicated on:</p>
  
  <p><a href="https://www.postgresql.org/docs/9.4/static/datatype-json.html" rel="noreferrer">https://www.postgresql.org/docs/9.4/static/datatype-json.html</a></p>
  
  <p>here my code:</p>
  
  <pre><code> UPDATE customer set phones ='{  {"type": "mobile", "phone": "001001"} ,
  {"type": "fix", "phone": "002002"}  }'::jsonb  
    where id ='4ca27243-6a55-4855-b0e6-d6e1d957f289';
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>ERROR:  invalid input syntax for type json
  LINE 1: UPDATE customer set phones ='{  {"type": "mobile", "phone": ...
                                      ^
  DETAIL:  Expected string or "}", but found "{".
  CONTEXT:  JSON data, line 1: {  {...
  SQL state: 22P02
  Character: 29
  </code></pre>
  
  <p>I need just record a lit of phones, need to enclose in a big name object like?  I mean for javascript , array of objets is not an object, but i dont know if that is accepted in jsonb of postresql</p>
  
  <p>{ phones:[ {"type": "mobile", "phone": "001001"} ,
      {"type": "fix", "phone": "002002"} ] }</p>