title: postgresql stored procedure input json parsing
body: <p>I am new to PostgreSQL. Here is what I am trying to achieve. I will be getting a json as text as the input for the procedure and I need to parse them inside the procedure to get the data from them and save data into the tables.</p>
  
  <p>Here is an example:</p>
  
  <p>this is the table.</p>
  
  <pre><code>    CREATE TABLE json_test2
      (
        id serial primary key,
        name text,
        age int
      )     
  </code></pre>
  
  <p>Now i am trying to create a procedure that will take a text as an input that contains json.</p>
  
  <pre><code>    {
          "data": [
              {
                  "name": "kumar",
                  "age": 12
              },
              {
                  "name": "anand",
                  "age": 25
              }
          ]
      }
  </code></pre>
  
  <p>please create a proc that will meet my requirement</p>