title: PostgreSql how to declare variable type list
body: <p>In PostgreSql procedure, I need to create a list of integers to use in a delete statement, as in the example:</p>
  
  <pre class="lang-sql prettyprint-override"><code>DELETE FROM appointment_virtual WHERE appointment_id IN (list_delete);
  </code></pre>
  
  <p>I need help with:</p>
  
  <p>How do I declare a list type variable?<br>
  I found the following form, but I was unsure if it serves the purpose of the DELETE statement:</p>
  
  <pre class="lang-sql prettyprint-override"><code>list_delete integer ARRAY;
  </code></pre>
  
  <p>How do I add items to this list variable?<br>
  I found the following way:</p>
  
  <pre class="lang-sql prettyprint-override"><code>list_delete = array_append (_delete, _appointment_id);
  </code></pre>
  
  <p>How to zero the contents of this list variable?<br>
  Is the syntax below correct?</p>
  
  <pre class="lang-sql prettyprint-override"><code>list_delete = [];
  </code></pre>
  
  <p>Thanks any help!</p>