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.steh...@gmail.com <mailto:pavel.steh...@gmail.com>> wrote:

    Hi

    2015-12-26 8:28 GMT+01:00 Kevin Waterson <kevin.water...@gmail.com
    <mailto:kevin.water...@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



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to