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 QAA03403 for postgres-redist; Mon, 17 Oct 1994 16:37:37 -0700 Resent-From: POSTGRES mailing list Resent-Message-Id: <199410172337.QAA03403@nobozo.CS.Berkeley.EDU> X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol Sender: owner-postman@postgres.Berkeley.EDU X-Return-Path: owner-postman Received: from maestro.srcc.lsu.edu (maestro.srcc.lsu.edu [130.39.129.1]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id QAA03393 for ; Mon, 17 Oct 1994 16:37:36 -0700 Received: by maestro.srcc.lsu.edu (4.1/SMI-4.1) id AA02734; Mon, 17 Oct 94 18:37:28 CDT Date: Mon, 17 Oct 94 18:37:28 CDT From: postgres@maestro.srcc.lsu.edu (Postgres) Message-Id: <9410172337.AA02734@maestro.srcc.lsu.edu> To: postgres@postgres.Berkeley.EDU Subject: Re: Tuple-Functions on variable tables ? Resent-To: postgres-redist@postgres.Berkeley.EDU Resent-Date: Mon, 17 Oct 94 16:37:37 -0700 Resent-XMts: smtp On 30 Sep 1994, Wolf-D. Ihlenfeldt writes > But how to I formulate a query with > my_func(class1,class1) > > or > > my_func(class3,class4) > > where class3 and 4 may have a slightly different structure, but do > contain the fields used in the function for the comparison. > I have not found a way to pass classes which are different to > those in the prototype htrough the parser. Is there some way > to do this ? You could do something like define function my_func (language = "c", returntype = bool, trusted="t", percall_cpu = "costly!!!") arg is (class1,class1) as "/path/myfunc.so" where class1 is a bogus class with no data. It simply has all the attributes you want to test. Then, when you create any real class that you want to test, you just have it inherit class1. This ought to work because C functions will take any class that inherits the one that it is defined to take. If you want to get real adventurous, you can use parts of the source code in your C function ( I recommend looking at the source for GetAttributeByName() ) to pull in the data for attributes that are not even inherited. Sean Steiner ssteiner@maestro.srcc.lsu.edu ============================================================================== 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. ==============================================================================