For example: I have a VIEW called "view1" which contains 'name' and 'slno' columns, now i want it to be display using FUNCTION called "f1" as shown below:
--Function
create or replace function f1(viewname varchar)
returns table (name varchar,slno integer) as
$body$
begin
return query
select * from viewname;
end;
$body$
language plpgsql;