From: Matthew Smith <mps@utas.edu.au>
To: Michael Fuhr <mike@fuhr.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: Help on a complex query (avg data for day of the week)
Date: Thu, 22 Dec 2005 13:59:01 +1100
Message-ID: <200512221359.01818.mps@utas.edu.au> (raw)
In-Reply-To: <20051222023755.GA62008@winnie.fuhr.org>
References: <200512191657.48139.mps@utas.edu.au>
<200512221159.24388.mps@utas.edu.au>
<20051222023755.GA62008@winnie.fuhr.org>
Michael,
Thanks heaps for that!
Cheers,
Matt Smith
On Thu, 22 Dec 2005 01:37 pm, Michael Fuhr wrote:
> 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;
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: mps@utas.edu.au, mike@fuhr.org
Subject: Re: Help on a complex query (avg data for day of the week)
In-Reply-To: <200512221359.01818.mps@utas.edu.au>
* 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