Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/3/07, elein <elein@xxxxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux