title: Declare an array in plpgsql and use it
body: <p>I'm trying to do 3 actions (2 delete and 1 update ) on an array of ent_id. This array is build in my script in the select.</p>
  <pre><code>CREATE
      OR REPLACE FUNCTION run_script()
      RETURNS VOID
  AS
  $$
  DECLARE
      all_ent bigint[];
  BEGIN
      select ent_id
      into all_ent
      from entretiens ent
      where ent.ent_statut = 'T';
  
      RAISE INFO 'Start';
  
      delete
      from documents
      where ent_id in (all_ent);
  
      delete
      from comite
      where ent_id in (all_ent);
  
      update entretiens ent
      set ent_statut = 'N'
      where ent_id in (all_ent);
  
      RAISE INFO 'End';
  
  END
  $$
      LANGUAGE plpgsql;
  
  SELECT run_script();
  </code></pre>
  <p>When I run the script I have this error :</p>
  <pre><code>ERROR: malformed array literal: &quot;535030&quot;
  Détail : Array value must start with &quot;{&quot; or dimension information.
  </code></pre>
  <p>Any suggestion ?</p>