date interpolation - Mailing list pgsql-sql

From Rob Wood
Subject date interpolation
Date
Msg-id Pine.LNX.4.44.0305251736050.29182-100000@dobber.ca
Whole thread Raw
Responses Re: date interpolation
List pgsql-sql
I am looking for a way to interpolate dates to create a nice output table.

example:

given this table:
id  | start_date | end_date
----+------------+-----------
101 | 2003-02-03 | 2003-02-05
102 | 2003-03-20 | 2003-03-24
:
:

I am looking for a SELECT to retrieve this table:
id  | date
----+------------
101 | 2003-02-03
101 | 2003-02-04
101 | 2003-02-05
102 | 2003-03-20
102 | 2003-03-21
102 | 2003-03-22
102 | 2003-03-23
102 | 2003-03-24
:
:

So far the closest solution I have come up with involves creating a dummy
table that contains a long list of dates that I can JOIN against in order 
to fill in the interpolated values.  It doesn't work very well, and gets 
slow with large tables.

any clever ideas would be appreciated.

Rob



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Quick question regarding indexes and NULLs in 7.3.3 -> 7.4
Next
From: Rod Taylor
Date:
Subject: Re: date interpolation