Re: Generate a series of single days from a table of intervals.

From: Paul Linehan <linehanp(at)tcd(dot)ie>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Generate a series of single days from a table of intervals.
Date: 2016-07-27 17:35:16
Message-ID: CAF4RT5TwyZW9VzJJp_JCmy1uMxM9fiCMT--oQ1giPZJ-52OKBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi, and thanks for your quick reply,

> https://www.postgresql.org/docs/9.5/static/functions-srf.html

I know about generate_series, but I would like this to
be generally applicable.

> See "LEFT JOIN" and "COALESCE"
>

Will do.

>> 2016-04-02 0

> Typo?

Yes :-)

>> I would like to do this using a recursive CTE if it's the best solution,
>> but I'm open to other approaches - different approaches appreciated.

> Really? That should be the last choice of execution strategy.

> This isn't a tree, I'm doubtful that a recursive CTE is needed.

But recursive CTEs can be used to generate series, and as I
said, I don't want to use a PostgreSQL specific function.

> https://www.postgresql.org/docs/9.5/static/functions-range.html

Will take a look, thanks again,

Paul...

> David J.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message David G. Johnston 2016-07-27 17:47:51 Re: Generate a series of single days from a table of intervals.
Previous Message David G. Johnston 2016-07-27 17:13:38 Re: Generate a series of single days from a table of intervals.