CREATE OR REPLACE FUNCTION get_data(v1 integer)
RETURNS setof part_movement
AS
$$
Select *
From part_movement
where id_area_final_destination = v1;
$$ LANGUAGE sql;
可以在手册中找到更多详细信息和示例:http ://www.postgresql.org/docs/current/static/xfunc-sql.html#XFUNC-sql-FUNCTIONS- RETURNING-SET