problem preforming double deletion
i want to write a trigger that causes another record to be deleted from another table something like this :
/*************function***********************/
CREATE OR REPLACE FUNCTION policy.on_delete_user_general_rule()
RETURNS "trigger" AS
$BODY$
BEGIN
DELETE FROM policy.general_rules WHERE id= OLD.rule_id ;
END;$BODY$
LANGUAGE 'plpgsql' STABLE;
ALTER FUNCTION policy.on_delete_user_general_rule() OWNER TO postgres;
GRANT EXECUTE ON FUNCTION policy.on_delete_user_general_rule() TO postgres;
/*****************the trigger*******************/
CREATE TRIGGER "1232"
BEFORE DELETE
ON policy.user_general_rules
FOR EACH ROW
EXECUTE PROCEDURE policy.on_delete_user_general_rule();
and i keep getting errors on line 2
any ideas anyone ??