title: PostgreSQL field type to store string, int, or json
body: <p>I want to store a table for variables with table definition like below</p>
  <pre><code>variable
  --------
  id           int
  var_type     int  0: number, 1: string, 2: json
  var_name     int
  var_value    ??? varchar or jsonb?
  </code></pre>
  <p>If I use varchar, how to store the json type variable and if, I am using jsonb how to store the int and string?</p>
  <p>The example json value that is stored,</p>
  <pre><code>[{&quot;name&quot;: &quot;Andy&quot;, &quot;email&quot; : &quot;andy@mail.id&quot;},{&quot;name&quot;: &quot;Cindy&quot;, &quot;email&quot; : &quot;cindy@mail.id&quot;}]
  </code></pre>
  <p>TIA</p>
  <p>Beny</p>