View Single Post

   
  #2 (permalink)  
Old 04-12-2008, 09:47 AM
Tom Lane
 
Posts: n/a
Default Re: interval / interval -> double operator

Andrew Hammond <andrew.george.hammond@gmail.com> writes:
> 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);
> $$;


What are the grounds for defining it that way rather than some other
way?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Reply With Quote