title: How to store a list of integers as variable in PostgreSQL
body: <p>I am just wondering how to store a list of integers as a variable in PostreSQL stored procedure. </p>
  
  <p>For example, I have statements like these:</p>
  
  <pre><code>   select A from B where C IN (1,2,3);
     select A from B where C IN (1,2);
  </code></pre>
  
  <p>And I want to declare a variable to store <code>(1,2,3)</code> or <code>(1,2)</code>. </p>
  
  <p>So I would end up with a statement like:</p>
  
  <pre><code>select A from B where C in numberList;
  </code></pre>
  
  <p>(numberList has the value (1,2,3))</p>
  
  <p>I don't know which datatype I should use,I looked up online and can't find there is a list type in psql. And what's the syntax for that as well?</p>