title: Identify json type in postgresql
body: <p>Is there a function - or a way to easily determine the json data type in postgresql?</p>
  <p>For example:</p>
  <pre><code>select key, value, pg_typeof(value) FROM jsonb_each('{&quot;foo&quot;:1,&quot;bar&quot;:&quot;2&quot;,&quot;ack&quot;:[1,2,3]}'::jsonb)
  </code></pre>
  <p>Returns:</p>
  <pre><code>key value   pg_typeof
  ack [1, 2, 3]   jsonb
  bar &quot;2&quot; jsonb
  foo 1   jsonb
  </code></pre>
  <p>How would I determine that the value for ack is an array, bar is a string, and foo is a number?</p>