Interval Division Workaround Suggestions (sub-day intervals only)?

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Interval Division Workaround Suggestions (sub-day intervals only)?
Date: 2012-05-29 17:50:12
Message-ID: 006c01cd3dc3$7fe7ff00$7fb7fd00$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Any suggestions on how to obtain the number of "X minute" intervals in "Y"
where "Y" is always less than 24 hours?

e.g., : '05:00:00'::interval / '00:06:00'::interval => 50 (integer)

I am guessing because intervals cover not-well-defined (variable) periods of
times (i.e., months, years) that the definition of "divided into" is not
stable enough implement a general division operator for.

From the Wiki:

http://wiki.postgresql.org/wiki/Working_with_Dates_and_Times_in_PostgreSQL

4. Multiplication and division of INTERVALS is under development and
discussion at this time

It is suggested that you avoid it until implementation is complete or you
may get unexpected results.

Thanks!

David J.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Angelico 2012-05-29 17:56:51 Re: Interval Division Workaround Suggestions (sub-day intervals only)?
Previous Message Michael Nolan 2012-05-29 17:38:11 Fwd: Disable Streaming Replication without restarting either master or slave