In > 7.3 you can also
CREATE OR REPLACE FUNCTION xxx() RETURNS TRIGGER AS'BEGINEND'LANGUAGE plpgsql;