pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gary Stainburn <gary.stainburn@ringways.co.uk>
To: pgsql-sql@postgresql.org
Subject: Re: date range to set of dates expansion
Date: Thu, 19 Jan 2012 15:59:27 +0000
Message-ID: <201201191559.27698.gary.stainburn@ringways.co.uk> (raw)
In-Reply-To: <201201191516.16802.gary.stainburn@ringways.co.uk>
References: <201201190713.34333.gary.stainburn@ringways.co.uk>
	<201201191511.46076.gary.stainburn@ringways.co.uk>
	<201201191516.16802.gary.stainburn@ringways.co.uk>

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 



view thread (10+ messages)  latest in thread

Message-ID: <201201191559.27698.gary.stainburn@ringways.co.uk>
Permalink:  ../201201191559.27698.gary.stainburn@ringways.co.uk/
Also on:    postgresql.org/message-id/201201191559.27698.gary.stainburn@ringways.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gary.stainburn@ringways.co.uk
  Subject: Re: date range to set of dates expansion
  In-Reply-To: <201201191559.27698.gary.stainburn@ringways.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox