Proposal: Division operator for (interval / interval => double precision)

2024-06-23 Thread Gurjeet Singh
Is there a desire to have a division operator / that takes dividend and divisor of types interval, and results in a quotient of type double precision. This would be helpful in calculating how many times the divisor interval can fit into the dividend interval. To complement this division operator,

Re: Proposal: Division operator for (interval / interval => double precision)

2024-06-23 Thread Kashif Zeeshan
Hi Its always a good idea to extend the functionality of PG. Thanks Kashif Zeeshan On Mon, Jun 24, 2024 at 5:57 AM Gurjeet Singh wrote: > Is there a desire to have a division operator / that takes dividend > and divisor of types interval, and results in a quotient of type > double precision. >

Re: Proposal: Division operator for (interval / interval => double precision)

2024-06-23 Thread David G. Johnston
On Sun, Jun 23, 2024 at 5:57 PM Gurjeet Singh wrote: > Is there a desire to have a division operator / that takes dividend > and divisor of types interval, and results in a quotient of type > double precision. [...] > ('365 days'::interval / '3 days'::interval) => 121 > ('365 days'::interval % '

Re: Proposal: Division operator for (interval / interval => double precision)

2024-06-24 Thread Laurenz Albe
On Sun, 2024-06-23 at 17:57 -0700, Gurjeet Singh wrote: > Is there a desire to have a division operator / that takes dividend > and divisor of types interval, and results in a quotient of type > double precision. > > This would be helpful in calculating how many times the divisor > interval can fi

Re: Proposal: Division operator for (interval / interval => double precision)

2024-06-24 Thread Ashutosh Bapat
On Mon, Jun 24, 2024 at 2:04 PM Laurenz Albe wrote: > On Sun, 2024-06-23 at 17:57 -0700, Gurjeet Singh wrote: > > Is there a desire to have a division operator / that takes dividend > > and divisor of types interval, and results in a quotient of type > > double precision. > > > > This would be he