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

From: Chris Angelico <rosuav(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Interval Division Workaround Suggestions (sub-day intervals only)?
Date: 2012-05-29 17:56:51
Message-ID: CAPTjJmq4aJa_BkmEFfqzgf65GGqTdKK+xmdn9f0GHA82Oegxfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, May 30, 2012 at 3:50 AM, David Johnston <polobo(at)yahoo(dot)com> wrote:
> 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)

Turn them into integer seconds:

select date_part('epoch','05:00:00'::interval)/date_part('epoch','00:06:00'::interval);

ChrisA

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Raghavendra 2012-05-29 18:04:54 Re: Disable Streaming Replication without restarting either master or slave
Previous Message David Johnston 2012-05-29 17:50:12 Interval Division Workaround Suggestions (sub-day intervals only)?