Re: interval / interval -> double operator

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: interval / interval -> double operator
Date: 2007-05-17 23:48:27
Message-ID: 15942.1179445707@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-05-17 23:51:34 Re: What is happening on buildfarm member baiji?
Previous Message Tom Lane 2007-05-17 23:45:50 Re: UTF8MatchText