Re: Recurring and non recurring events. - Mailing list pgsql-general

From Gavin Flower
Subject Re: Recurring and non recurring events.
Date
Msg-id 567EEAF2.1070304@archidevsys.co.nz
Whole thread Raw
In response to Re: Recurring and non recurring events.  (Kevin Waterson <kevin.waterson@gmail.com>)
Responses Re: Recurring and non recurring events.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Pleas don't top post - see comment at the bottom of this email.

On 27/12/15 01:03, Kevin Waterson wrote:
> Thanks, as I am new to postgres, I was unaware of this function.
> To go with this, I guess I will need a table with which to store
> intervals, start and end dates?
>
> eg
> CREATE table events(
>     id serial primary key,
>     start_timestamp timestamp,
>     end_timestamp timestamp,
>     interval
>
> with dateRange as
>   (
>   SELECT min(start_timestamp) as first_date, max(start_timestamp) as
> last_date
>   FROM events
>   )
> select
>     generate_series(first_date, last_date, '1
> hour'::interval)::timestamp as date_hour
> from dateRange;
>
>
> or something??
>
> Kind regards
> Kevin
>
>
> On Sat, Dec 26, 2015 at 7:22 PM, Pavel Stehule
> <pavel.stehule@gmail.com <mailto:pavel.stehule@gmail.com>> wrote:
>
>     Hi
>
>     2015-12-26 8:28 GMT+01:00 Kevin Waterson <kevin.waterson@gmail.com
>     <mailto:kevin.waterson@gmail.com>>:
>
>         I wish to set up a table of recurring, and non-recurring events.
>         I have been looking at
>         http://justatheory.com/computers/databases/postgresql/recurring_events.html
>         which looks nice (complex but nice) and wonder if there was a
>         better option for this in more recent pgsql versions.
>
>
[...]

In this list, the convention is to post replies at the end (with some
rare exceptions), or interspersed when appropriate, and to omit parts no
longer relevant.

The motivation of bottom posting like this: is that people get to see
the context before the reply, AND emails don't end up getting longer &
longer as people reply at the beginning forgetting to trim the now
irrelevant stuff at the end.


Cheers,
Gavin



pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Recurring and non recurring events.
Next
From: Tom Lane
Date:
Subject: Re: Recurring and non recurring events.