
DECLARE
	unit text;
BEGIN
	unit := lower(interval_unit);
	IF unit NOT IN ('second', 'minute', 'hour', 'day') THEN
		RAISE '"%" is not a valid interval unit', interval_unit
			USING ERRCODE = 'invalid_parameter_value';
	END IF;
	RETURN justify_hours(concat(n, ' ', unit)::interval);
END;
