title: Function Returning Set Of Columns
body: <p>I am trying to return schemas of all the tables present in my schema/database but it's throwing an error-</p>
  <p>My Code-</p>
  <pre><code>create or replace function Table_Schema(schemaname text, tablename text) 
   RETURNS SETOF varchar
   as
  $body$
  declare
    _query varchar;
  begin
   _query := 'select * from information_schema.columns WHERE table_name = '''||tablename||''' ';
    RAISE NOTICE '&quot;%&quot;' , _query;
  
     -- execute and return all
     RETURN QUERY EXECUTE _query;
  end;
  $body$
  language plpgsql;
  
  
  copy(select  
    Table_Schema(table_schema, table_name)
  from information_schema.tables
  where 
    table_schema  in ('public')) to 'C:\test\Table_Schema.csv' DELIMITER ',' CSV HEADER;
  </code></pre>
  <p>Could you please help me ? I guess return type is the issue.  Thanks</p>