Re: [GENERAL] SELECT Question

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kris Jurka <books(at)ejurka(dot)com>, Alex <alex(at)meerkatsoft(dot)com>, Lada 'Ray' Lostak <ray(at)unreal64(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [GENERAL] SELECT Question
Date: 2004-01-29 00:55:17
Message-ID: 401859F5.9050007@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

Tom Lane wrote:
> 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.
>

The attached patch introduces a C function as discussed above. Looks
like this:

regression=# select * from pg_generate(42,45);
pg_generate
-------------
42
43
44
45
(4 rows)

It also makes use of the function to replace the hard-wired parts of the
information_schema.

I have not yet made documentation changes, pending an answer to this and
other questions: what should this function be called? I'm at a loss as
to a good name -- the idea of the name pg_generate() was that the
function acts as a non-persistent sequence generator, but I don't really
like that name.

Any ideas, or other comments? For example, should pg_generate() allow a
finish value < start and therefore count backward? Should there be a
three argument version allowing a step size?

Thanks,

Joe

Attachment Content-Type Size
current.75.diff text/plain 5.5 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-01-29 01:33:47 Re: Specifying many rows in a table
Previous Message Steve Atkins 2004-01-29 00:14:21 Re: Specifying many rows in a table

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2004-01-29 11:11:54 Re: support for printing/exporting xml
Previous Message Claudio Natoli 2004-01-28 22:48:06 Re: [PATCHES] win32 patch: allows source to be compiled + "run" u