From: Michael Fuhr <mike@fuhr.org>
To: Matthew Smith <mps@utas.edu.au>
Cc: Richard Huxton <dev@archonet.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Help on a complex query (avg data for day of the week)
Date: Wed, 21 Dec 2005 19:37:55 -0700
Message-ID: <20051222023755.GA62008@winnie.fuhr.org> (raw)
In-Reply-To: <200512221159.24388.mps@utas.edu.au>
References: <200512191657.48139.mps@utas.edu.au>
<43A928C2.8060901@archonet.com>
<200512221159.24388.mps@utas.edu.au>
On Thu, Dec 22, 2005 at 11:59:24AM +1100, Matthew Smith wrote:
> Sadly I am using 7.3, it seems that generate_series() is 8.0 and later.
Yes, but it's easily written in PL/pgSQL for earlier versions.
Example:
CREATE FUNCTION generate_series(integer, integer)
RETURNS SETOF integer AS '
DECLARE
i integer;
BEGIN
FOR i IN $1 .. $2 LOOP
RETURN NEXT i;
END LOOP;
RETURN;
END;
' LANGUAGE plpgsql VOLATILE STRICT;
--
Michael Fuhr
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: mike@fuhr.org, mps@utas.edu.au, dev@archonet.com
Subject: Re: Help on a complex query (avg data for day of the week)
In-Reply-To: <20051222023755.GA62008@winnie.fuhr.org>
* 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