Re: Interval Division Workaround Suggestions (sub-day intervals only)? - Mailing list pgsql-general

From Chris Angelico
Subject Re: Interval Division Workaround Suggestions (sub-day intervals only)?
Date
Msg-id CAPTjJmq4aJa_BkmEFfqzgf65GGqTdKK+xmdn9f0GHA82Oegxfw@mail.gmail.com
Whole thread Raw
In response to Interval Division Workaround Suggestions (sub-day intervals only)?  ("David Johnston" <polobo@yahoo.com>)
List pgsql-general
On Wed, May 30, 2012 at 3:50 AM, David Johnston <polobo@yahoo.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

pgsql-general by date:

Previous
From: "David Johnston"
Date:
Subject: Interval Division Workaround Suggestions (sub-day intervals only)?
Next
From: Raghavendra
Date:
Subject: Re: Disable Streaming Replication without restarting either master or slave