Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group