agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedFrom: Paul M. Aoki <aoki@cs.berkeley.edu>
To: Ray E. Flanery Jr <flanery@tram.epm.ornl.gov>
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: function calls from libpq.
Date: Fri, 07 Oct 94 16:51:52 -0700
Message-ID: <199410072351.QAA02176@faerie.CS.Berkeley.EDU> (raw)
In-Reply-To: <9410072035.AA03909@tram.epm.ornl.gov>
flanery@tram.epm.ornl.gov (Ray E. Flanery Jr) writes:
> I have a function defined for a database and want to access it through
> libpq. PQfn seems to be set up for POSTGRES functions and it is not
> clear how to do this through the portals. Any clues?
to use PQfn, you need to register a C function in pg_proc with the
right argument types. there is no difference between calling built-in
C functions and user-defined C functions. the interface is documented
in the LIBPQ section of the reference manual. C functions cannot
return sets of tuples so there isn't much of a question about using
portals with them.
it is true that you can't use PQfn for POSTQUEL functions, if that's
what you mean. those you can call directly from the query language
(PQexec("retrieve (x=myfunc())")) so their interactions with portals
should be relatively clear (since the interactions are the same as
with any other query).
--
Paul M. Aoki | University of California at Berkeley
aoki@CS.Berkeley.EDU | Dept. of EECS, Computer Science Division (#1776)
| Berkeley, CA 94720-1776
==============================================================================
To add/remove yourself to/from the POSTGRES mailing list: send mail with
the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"
If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
a human will deal with it. DO NOT post to the "postgres" mailing list.
==============================================================================
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: postgres@postgres.berkeley.edu
Cc: aoki@cs.berkeley.edu, flanery@tram.epm.ornl.gov
Subject: Re: function calls from libpq.
In-Reply-To: <199410072351.QAA02176@faerie.CS.Berkeley.EDU>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox