Re: plpgsql direct from C?

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: "James Harper" <james(dot)harper(at)bendigoit(dot)com(dot)au>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: plpgsql direct from C?
Date: 2006-02-05 02:58:16
Message-ID: 871wyizf3r.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"James Harper" <james(dot)harper(at)bendigoit(dot)com(dot)au> writes:

> Is there an API method to be able to execute pl/pgsql (or any other
> language) code directly from C?
>
> Eg (please excuse the line wrapping, and the fact that this doesn't
> represent a case where this would actually be useful!)
>
> result = PQexecPL("plpgsql", "IF $1 = 'xyzzy" THEN SELECT * FROM fnord
> END IF;", "xyzzy");

Not currently. Any server-side code has to be in a function, so such
an API would have to create a temporary function (which you might or
might not have privileges to do), call it, and then drop it. It's
theoretically possible I guess, but would be ugly and slow.

-Doug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Niederland 2006-02-05 03:47:31 update with subquery - unexpected results
Previous Message James Harper 2006-02-05 02:47:05 plpgsql direct from C?