代码
CREATE OR REPLACE FUNCTION getfoo() RETURNS SETOF record AS
$BODY$begin
select * from "MyFirstPGSQL";
end;$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100
ROWS 1000;在pgAdmin自带的查询工具中执行
select * from getfoo() as tt(id integer,myname character varying(50),pwd character varying(50));
or
select "getfoo"(); 都报错
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 "getfoo" line 2 at SQL statement