title: Return BIGINT[] FROM postgresql function
body: <p>I know that some similar questions have been asked before but none of the answers worked for me!
  I use POSTGRESQL 8.4 and am trying to return an array of BIGINT values from a function. 
  My query looks like: </p>
  
  <pre><code>CREATE OR REPLACE FUNCTION public.bigint_func(
      in "in_arg" BIGINT)
    RETURNS SETOF BIGINT
    AS
  $body$
  DECLARE bigint_list BIGINT [ ];
  BEGIN
        SELECT
          id
        FROM
          table1
      INTO bigint_list;
    RETURN NEXT;
    END
  $body$
    LANGUAGE 'plpgsql'
    VOLATILE
    CALLED ON NULL INPUT
    SECURITY INVOKER;
  </code></pre>
  
  <p>and I'd like to use that function as below: </p>
  
  <pre><code>SELECT * 
  FROM 
  table1 
  JOIN (SELECT ids
    FROM bigint_func(123))t2 ON table1.id = t2.id 
  </code></pre>
  
  <p>but I get the following error:</p>
  
  <pre><code>ERROR:  query has no destination for result data
  HINT:  If you want to discard the results of a SELECT, use PERFORM instead.
  </code></pre>
  
  <p>How should I write the code for the function? </p>