Postgresql - Error in function that returns table I just defined this function to return all column names from a given table:

create or replace function GET_COLUMNS(in tbl_name character varying(30))
returns table(colunas character varying) as $$
begin
    SELECT column_name
    FROM information_schema.columns
    WHERE table_schema = 'Main'
    AND table_name   = tbl_name;
end;
$$ language 'plpgsql'


But When I call it using select * from get_columns('tabfuncionarios'); I just got the following error:


ERROR:  query has no destination for result data
HINT:  If you want to discard the results of a SELECT, use PERFORM instead.
CONTEXT:  PL/pgSQL function get_columns(character varying) line 3 at SQL statement



I'm using postgresql 9.4.5 version
You don't need plpgsql for this. A plain sql function will do: 

create or replace function GET_COLUMNS(in tbl_name character varying(30))
   returns table(colunas character varying) 
as 
$$
    SELECT column_name
    FROM information_schema.columns
    WHERE table_schema = 'Main'
    AND table_name   = tbl_name;
$$ 
language sql;


Additionally: the language name is an identifier. Don't put it in single quotes.