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

Поиск
Список
Период
Сортировка
От Gurjeet Singh
Тема Proposal: Division operator for (interval / interval => double precision)
Дата
Msg-id CABwTF4W7x=q7tPrhPa6cjZwstDk2d3oYnTQydoc6=YvCTZzY_w@mail.gmail.com
обсуждение исходный текст
Ответы Re: Proposal: Division operator for (interval / interval => double precision)  (Kashif Zeeshan <kashi.zeeshan@gmail.com>)
Re: Proposal: Division operator for (interval / interval => double precision)  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: Proposal: Division operator for (interval / interval => double precision)  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-hackers
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, it would be desirable to also
have a remainder operator %.

For example,

('365 days'::interval / '5 days'::interval) => 73
('365 days'::interval % '5 days'::interval) => 0

('365 days'::interval / '3 days'::interval) => 121
('365 days'::interval % '3 days'::interval) => 2

Best regards,
Gurjeet
http://Gurje.et



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Avoid incomplete copy string (src/backend/access/transam/xlog.c)
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Parallel CREATE INDEX for GIN indexes