Skip site navigation (1) Skip section navigation (2)

Re: dynamic OUT parameters?

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: gherzig(at)fmed(dot)uba(dot)ar
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: dynamic OUT parameters?
Date: 2009-02-01 03:42:12
Message-ID: 49851A14.40709@postnewspapers.com.au (view raw or flat)
Thread:
Lists: pgsql-sql
gherzig(at)fmed(dot)uba(dot)ar wrote:

> Well, aparenty my problem remains, because the boss want that the
> programmers just need to call
> select * from report('table_name').

Then, AFAIK, you're not going to have much luck, as Pg needs to know the
columns that'll be output before the function is called. Applications
and DB access interfaces also usually also need to know the column list
beforehand.

If you return a refcursor you can at least use:

SELECT report('table_name');
FETCH ALL IN 'cursorname';

The documentation has a more full example:

http://www.postgresql.org/docs/8.2/interactive/plpgsql-cursors.html#AEN40465

Personally, I find it difficult to imagine what could be wrong with that.

--
Craig Ringer

In response to

Responses

pgsql-sql by date

Next:From: Ivan Sergio BorgonovoDate: 2009-02-01 09:54:12
Subject: Re: dynamic OUT parameters?
Previous:From: gherzigDate: 2009-02-01 01:13:27
Subject: Re: dynamic OUT parameters?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group