Re: Calculating repeating events - functionality lost with the demise of tinterval ?
В списке pgsql-novice по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Calculating repeating events - functionality lost with the demise of tinterval ? |
| Дата | |
| Msg-id | 13182.1215018119@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Calculating repeating events - functionality lost with the demise of tinterval ? (Daniel <psql-novice@netzach.co.il>) |
| Ответы |
Re: Calculating repeating events - functionality lost with
the demise of tinterval ?
|
| Список | pgsql-novice |
Daniel <psql-novice@netzach.co.il> writes:
>> If that doesn't satisfy your requirements, you need to be more clear
>> about what they are.
> Apologies for the lack of clarity.
> Try repeat_frequency='1 month'
Ah. Well, with something like that, you really can't speak in terms of
modulo, because months aren't all the same length. I'd be inclined to
solve this with a small plpgsql function, along the lines of
curdate := start_date;
while curdate < test_date loop
curdate := curdate + repeat_interval;
end loop;
return (curdate = test_date);
Kinda grotty but there probably isn't any cleaner solution that really
works for arbitrary intervals.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера