Yet another potential addition to the family of operators. Some guy was asking for it on IRC so...
CREATE OR REPLACE FUNCTION interval_over_interval(interval, interval) RETURNS float STRICT IMMUTABLE LANGUAGE sql AS $$ SELECT extract(epoch from $1)::float / extract(epoch from $2); $$; CREATE OPERATOR / ( leftarg = interval , rightarg = interval , procedure = interval_over_interval ); ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org