Re: Can a function be parameter in PL/PGSQL function?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Can a function be parameter in PL/PGSQL function?
Дата
Msg-id b42b73150702051228i25bf5d2fhb288e87aeb97c9f5@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Can a function be parameter in PL/PGSQL function?  (elein <elein@varlena.com>)
Список pgsql-general
On 2/3/07, elein <elein@varlena.com> wrote:
> On Tue, Jan 30, 2007 at 12:32:04PM -0800, Karen Hill wrote:
> > Is it possible to have a pl/pgsql function take another pl/pgsql
> > function as one of the parameters?

I think that OP meant (correct me if I'm wrong!) to be able to do
something like:

create function bar(text) returns text as $$ select $1 || 'xyz'; $$
language sql;

create function something_complex(regprocedure) returns void as [...]
language plpgsql;

select something_complex(bar(text));

...so you pass the callback 'bar' to the complex function which
executes it over something.  This isn't possible currently, but you
can fudge it with dynamic sql for simple things (no arrays, records,
or cursors), or work up something more general solution with a C
go-between.

merlin

В списке pgsql-general по дате отправления:

Предыдущее
От: Gene
Дата:
Сообщение: postgresql fails to start after symlinking pgdata dir
Следующее
От: Devrim GUNDUZ
Дата:
Сообщение: New RPM Sets for Fedora Core / Red Hat Enterprise Linux