Something that reconcile solutions of both Daniels :-) Little more elegant.
CREATE FUNCTION abs(interval) RETURNS interval AS $$ SELECT GREATEST(-$1,$1); $$ LANGUAGE sql immutable;