The following bug has been logged on the website:
Bug reference: 6707
Logged by: LiFeAiR
Email address: lifeair(at)gmail(dot)com
PostgreSQL version: 9.1.4
Operating system: FREE BSD
Description:
CREATE OR REPLACE FUNCTION test() RETURNS integer AS
$BODY$
DECLARE
_r RECORD;
BEGIN
CREATE TEMP TABLE test(id int);
_r := ROW(NULL)::test;
_r:=NULL;
DROP TABLE test CASCADE;
RETURN 1;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
select test();