Insert trigger function: If query affects no rows then return `null` Insert trigger function is modified to have `IF r IS NULL THEN RETURN null; ELSE RETURN r; END IF;` in return statement.