Re: Can a function be parameter in PL/PGSQL function? - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Can a function be parameter in PL/PGSQL function?
Date
Msg-id b42b73150702051228i25bf5d2fhb288e87aeb97c9f5@mail.gmail.com
Whole thread Raw
In response to Re: Can a function be parameter in PL/PGSQL function?  (elein <elein@varlena.com>)
List 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 by date:

Previous
From: Gene
Date:
Subject: postgresql fails to start after symlinking pgdata dir
Next
From: Devrim GUNDUZ
Date:
Subject: New RPM Sets for Fedora Core / Red Hat Enterprise Linux