title: PL/PgSQL: RETURNS TABLE output is comma delimited without values
body: <p>The following PL/pgSQl script returns the correct number of rows, but the output is a list of comma separated values in brackets as follows:</p>
  
  <p>(,,) (,,) (,,) (,,) (,,) . . (,,)</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION Get_Airports_in_Country(countryCode TEXT) 
  RETURNS TABLE(gid int, iko text, name text) AS $$
   DECLARE
      cntry_geom cntry02.the_geom%TYPE;       
   BEGIN   
      SELECT the_geom INTO cntry_geom from cntry02 where iso_2digit = $1;
  
      RETURN QUERY
      SELECT gid, iko, name
        FROM airport
       WHERE ST_Within(the_geom, cntry_geom);
   END;
  $$
  LANGUAGE plpgsql;
  
  SELECT Get_Airports_in_Country('CA');
  </code></pre>
  
  <p>I am using PostgreSQL 8.4.</p>
  
  <p>Any idea what I am missing here?</p>