Return-Path: owner-postman Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id QAA11323 for postgres-redist; Fri, 7 Oct 1994 16:52:14 -0700 Resent-From: POSTGRES mailing list Resent-Message-Id: <199410072352.QAA11323@nobozo.CS.Berkeley.EDU> Sender: owner-postman@postgres.Berkeley.EDU X-Return-Path: owner-postman Received: from faerie.CS.Berkeley.EDU (faerie.CS.Berkeley.EDU [128.32.37.53]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with ESMTP id QAA11313 for ; Fri, 7 Oct 1994 16:52:13 -0700 Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by faerie.CS.Berkeley.EDU (8.6.9/8.1B) with SMTP id QAA02176; Fri, 7 Oct 1994 16:51:58 -0700 Message-Id: <199410072351.QAA02176@faerie.CS.Berkeley.EDU> X-Authentication-Warning: faerie.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol From: aoki@cs.berkeley.edu (Paul M. Aoki) To: flanery@tram.epm.ornl.gov (Ray E. Flanery Jr) Cc: postgres@postgres.Berkeley.EDU Subject: Re: function calls from libpq. Reply-To: aoki@cs.berkeley.edu (Paul M. Aoki) In-reply-to: Your message of Fri, 7 Oct 94 16:35:04 -0400 <9410072035.AA03909@tram.epm.ornl.gov> Date: Fri, 07 Oct 94 16:51:52 -0700 X-Sender: aoki@postgres.Berkeley.EDU Resent-To: postgres-redist@postgres.Berkeley.EDU X-Mts: smtp Resent-Date: Fri, 07 Oct 94 16:52:14 -0700 Resent-XMts: smtp 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. ==============================================================================