Francesco Casadei <f_casadei@libero.it> writes:
> I want to publish these events on web and be able to show 'today events'. An
> event happens today if:
> start_date + n * recurrence = now()
If you only want accuracy to the nearest day, I'd think you should be
using type "date" not type "timestamp". Date subtraction gives
integers:
test71=# select current_date - '2002-01-20'::date;
?column?
----------
6
(1 row)
so making "recurrence" an integer too solves the problem.
regards, tom lane