Search Postgresql Archives

Re: Recurring and non recurring events.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx <mailto:pavel.stehule@xxxxxxxxx>> wrote:

    Hi

    2015-12-26 8:28 GMT+01:00 Kevin Waterson <kevin.waterson@xxxxxxxxx
    <mailto:kevin.waterson@xxxxxxxxx>>:

        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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux