Re: date range to set of dates expansion

From: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: date range to set of dates expansion
Date: 2012-01-19 15:59:27
Message-ID: 201201191559.27698.gary.stainburn@ringways.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

The following code works in 8.4 but not 8.3.
Anyone know why, or what I need to do to change it?

SELECT aid, asid,
date_range (asdate, afdate)::date AS asdate,
acomments
FROM availability

In 8.4 it returns the expanded dataset as required. In 8.3 I get:

ERROR: set-valued function called in context that cannot accept a set
CONTEXT: PL/pgSQL function "date_range" line 4 at RETURN NEXT

Is there a way to use the integer only generate_series in 8.3 to generate
dates by typecasting to/from integers?

--
Gary Stainburn
Group I.T. Manager
Ringways Garages
http://www.ringways.co.uk

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Gary Stainburn 2012-01-19 16:10:15 Re: SOLVED - date range to set of dates expansion
Previous Message Gary Stainburn 2012-01-19 15:16:16 Re: date range to set of dates expansion