Re: Fwd: Set-valued function in wrong context - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: Fwd: Set-valued function in wrong context
Date
Msg-id 48EE6A0A.2040001@iol.ie
Whole thread Raw
In response to Re: Fwd: Set-valued function in wrong context  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-general
On 09/10/2008 21:25, Stephan Szabo wrote:
> I think you'd end up wanting something like:
>  FROM ( select a * interval '1 minute' from generate_series(0, TotalMins,
> mins_delta) as s(a) ) as s(a)
>
> I changed the concatenation and cast into an interval multiply, but you
> could easily do things the other way as well.

Great - thanks!

I also came up with the following after posting, when the brain finally
kicked into gear :-)

select start_time + cast(s.a::text || ' minutes' as interval)
from generate_series(0, TotalMins, mins_delta) as s(a)

Thanks for the help.

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Fwd: Set-valued function in wrong context
Next
From: Greg Smith
Date:
Subject: Re: logging SQL statements