Hello, my code works well: CREATE TABLE Foo(a integer, b integer); CREATE OR REPLACE FUNCTION ret_foo() RETURNS Foo AS $$ DECLARE r Foo; BEGIN r := (10,20); --default RETURN r; END; $$ LANGUAGE plpgsql; SELECT ret_foo(); CREATE OR REPLACE FUNCTION trig() RETURNS TRIGGER AS $$ BEGIN NEW := ret_foo(); RETURN NEW; END; $$ LANGUAGE plpgsql; CREATE TRIGGER footrig BEFORE INSERT ON Foo FOR EACH ROW EXECUTE PROCEDURE trig(); INSERT INTO Foo VALUES(0,0); Regards Pavel Stehule