title: How do I unnest an array inside a function?
body: <pre><code>create or replace function pd.check(
      interval_ text[]) 
  
  returns void as
  
  $BODY$
  BEGIN
  
  EXECUTE '
  drop table if exists check_;
  create temp table check_ 
  as
  (
      select unnest(' || interval_ || ')
  ) ;
  ';
  END;
  $BODY$
  LANGUAGE PLPGSQL volatile;
  </code></pre>
  
  <p>I am running it as </p>
  
  <pre><code>select pd.check(ARRAY['2','3','4']);
  </code></pre>
  
  <p>It gives me an error : </p>
  
  <blockquote>
    <p>operator is not unique: unknown || text[]</p>
    
    <p>HINT:  Could not choose a best candidate operator. You may need to add explicit type casts.</p>
  </blockquote>