%ROWTYPE声明变量
CREATE OR REPLACE PROCEDURE testatlasdb() AS $$
DECLARE
v_ss at_tb2%ROWTYPE;
BEGIN
select * into v_ss from at_tb2 limit 1;
raise notice '%', v_ss.id;
raise notice '%',v_ss.name;
END;
$$ LANGUAGE plpgsql;
atlasdb=# select * from at_tb2;
id | name
----+-----------
1 | before s1
2 | after s1
(2 rows)
atlasdb=# call testatlasdb();
NOTICE: 1
NOTICE: before s1
CALL