Re: Recurring events

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Francesco Casadei <f_casadei(at)libero(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Recurring events
Date: 2002-01-26 17:04:14
Message-ID: 11196.1012064654@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Francesco Casadei <f_casadei(at)libero(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frank Joerdens 2002-01-26 18:02:02 Re: Problems with initdb on Cygwin
Previous Message Francesco Casadei 2002-01-26 16:27:41 Recurring events