title: PostgreSQL - Array as function parameter
body: <p>I want to know if it's posible to do something like this:</p>
  
  <pre><code>CREATE OR REPLACE function my_funct(some_data some_type, array int[])
  RETURNS TABLE(code int, desc varchar)
  LANGUAGE plpgsql
  as $function$
  DECLARE
    ..
  BEGIN
   WHILE some_condition &lt; array.size --i know this doesn't exists 
    LOOP
    INSERT INTO some_table values(array_data[1]); --I want to insert data from 
  the array as long as it has data
    END LOOP;
    RETURN QUERY select 1001, cast ('DONE!' as varchar);
  END;
  $function$
  </code></pre>
  
  <p>i would appreciate any response!
  thanks!</p>