Re: SELECT Question - Mailing list pgsql-general

From Tom Lane
Subject Re: SELECT Question
Date
Msg-id 5344.1069350351@sss.pgh.pa.us
Whole thread Raw
In response to Re: SELECT Question  (Joe Conway <mail@joeconway.com>)
Responses Re: SELECT Question
List pgsql-general
Joe Conway <mail@joeconway.com> writes:
> Kris Jurka wrote:
>> A useful generic function would be one something like range(min,max) that
>> would return a set of rows so you wouldn't have to actually have a table.

> You mean like this?

> CREATE OR REPLACE FUNCTION test(int,int) RETURNS SETOF int AS '
> BEGIN
>    FOR i IN $1..$2 LOOP
>      RETURN NEXT i;
>    END LOOP;
>    RETURN;
> END;
> ' LANGUAGE 'plpgsql' STRICT IMMUTABLE;

I was thinking of proposing that we provide something just about like
that as a standard function (written in C, not in plpgsql, so that it
would be available whether or not you'd installed plpgsql).  There are
some places in the information_schema that desperately need it ---
right now, the value of FUNC_MAX_ARGS is effectively hard-wired into
some of the information_schema views, which means they are broken if
one changes that #define.  We could fix this if we had a function like
the above and exported FUNC_MAX_ARGS as a read-only GUC variable.

            regards, tom lane

pgsql-general by date:

Previous
From: konf@chalu.cz
Date:
Subject: Re: tsearch2 installation
Next
From: Joe Conway
Date:
Subject: Re: SELECT Question