BUG #5227: please add a divide operator for intervals - Mailing list pgsql-bugs

From Michal Pasternak
Subject BUG #5227: please add a divide operator for intervals
Date
Msg-id 200912022231.nB2MVbgW021757@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5227: please add a divide operator for intervals  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      5227
Logged by:          Michal Pasternak
Email address:      michal.dtz@gmail.com
PostgreSQL version: 8.4
Operating system:   doesn't matter
Description:        please add a divide operator for intervals
Details:

Please add a divide operator for INTERVAL type, if possible.

db=# SELECT '15 seconds'::INTERVAL / '15 seconds'::INTERVAL;
ERROR:  operator does not exist: interval / interval
LINE 1: SELECT '15 seconds'::INTERVAL / '15 seconds'::INTERVAL;
                                      ^
HINT:  No operator matches the given name and argument type(s). You might
need to add explicit type casts.


db=# SELECT EXTRACT(EPOCH FROM '15 seconds'::INTERVAL) / EXTRACT(EPOCH FROM
'15 seconds'::INTERVAL);
 ?column?
----------
        1
(1 row)

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Assertion failure with a subtransaction and cursor
Next
From: Tom Lane
Date:
Subject: Re: BUG #5225: create table: cast necessary for constant??