title: Insert json into array of table's field in Postgres
body: <p>PHP returns me the json:</p>
  
  <pre><code>{          
        "date"    : "2014-02-06",
        "typeDate": "local",
        "events"  : [
                      "To get know how Sherlock survived",
                      "Find who killed the President Kennedy",
                      "Cook met"
                    ]
         }
  </code></pre>
  
  <p>I need to insert this object into table's field which has the array of such objects:</p>
  
  <pre><code>{
       "dates": [   
       {          
        "date"    : "2014-02-06",
        "typeDate": "local",
        "events"  : [
                  "Kill John Connor",
                  "Kill T-1000",
                  "Listen Moon sonata"
                ]
       },
       {        
        "date"    : "2014-02-07",
        "typeDate": "local",
        "events"  : [
                  "Fix Enstain's theory",
                  "Take pizza"
                ]
         }
     ]
  }
  </code></pre>
  
  <p>How to do this correct ? Trying to use the example</p>
  
  <pre><code>INSERT INTO aa VALUES (1, 'my_json_record');
  </code></pre>
  
  <p>I'm getting the error about structure of json.</p>