Re: Fwd: Set-valued function in wrong context

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: 'PostgreSQL' <pgsql-general(at)postgresql(dot)org>
Subject: Re: Fwd: Set-valued function in wrong context
Date: 2008-10-09 20:31:06
Message-ID: 48EE6A0A.2040001@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2008-10-09 20:40:54 Re: logging SQL statements
Previous Message Stephan Szabo 2008-10-09 20:25:15 Re: Fwd: Set-valued function in wrong context