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

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Karen Hill" <karen_hill22(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Can a function be parameter in PL/PGSQL function?
Date: 2007-01-31 14:03:03
Message-ID: b42b73150701310603q5d58f270n7b41a1e651f4dd00@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 30 Jan 2007 12:32:04 -0800, Karen Hill <karen_hill22(at)yahoo(dot)com> wrote:
> Is it possible to have a pl/pgsql function take another pl/pgsql
> function as one of the parameters?

not exactly. you can take a string and execute it via dynamic sql, but
this is going to cause problems with record and array types and
generally just uglify your code. If you want to implement a callback,
you can improvise one if you are willing to cut a little C:

http://archives.postgresql.org/pgsql-performance/2005-11/msg00012.php

I've followed this mechanism, and it works...

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2007-01-31 14:19:33 Re: DBMS Engines and Performance
Previous Message Merlin Moncure 2007-01-31 13:55:37 Re: Any Plans for cross database queries on the same server?