Re: interval / interval -> double operator - Mailing list pgsql-hackers

From Tom Lane
Subject Re: interval / interval -> double operator
Date
Msg-id 15942.1179445707@sss.pgh.pa.us
Whole thread Raw
In response to interval / interval -> double operator  (Andrew Hammond <andrew.george.hammond@gmail.com>)
Responses Re: interval / interval -> double operator  ("Andrew Hammond" <andrew.george.hammond@gmail.com>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: What is happening on buildfarm member baiji?
Next
From: Tom Lane
Date:
Subject: Re: What is happening on buildfarm member baiji?