title: Using multi-valued parameter with IN()
body: <p>I'm having trouble with this postgres function using a multi-valued (comma separated) parameter as a filter in my where clause using IN().</p>
  
  <hr>
  
  <pre><code>CREATE FUNCTION company_sites_report( company_list text )
    RETURNS TABLE(company text, num_suppliers BIGINT)
  LANGUAGE SQL
  AS $$
  
  SELECT company, count(supplier_id) num_suppliers
  FROM MySitesTable
  <b>WHERE company IN ($1)</b>
  GROUP BY company;
  
  $$; </code></pre>
  
  <hr>
  
  <p>So when I call the function: </p>
  
  <pre><code>SELECT * 
  FROM company_sites_report( 'Company1,Company2' );
  </code></pre>
  
  <p>It seems to treat the parameter value as one whole string and not split it into the particular strings (csv). How do I get it to behave as I need?</p>