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 VAA04067 for postgres-redist; Thu, 29 Sep 1994 21:44:32 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199409300444.VAA04067@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 tutkie.tutkie.tut.ac.jp (tutkie.tut.ac.jp [133.15.160.64]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with ESMTP id VAA04057 for <postgres@postgres.berkeley.edu>; Thu, 29 Sep 1994 21:44:22 -0700
Received: from molout.tutkie.tut.ac.jp by tutkie.tutkie.tut.ac.jp (8.6.5+2.3W/6.4J.6)
	id NAA07050; Fri, 30 Sep 1994 13:44:02 +0900
Received: by molout.tutkie.tut.ac.jp (4.30/6.4J.6)
	id AA07197; Fri, 30 Sep 94 13:45:19 jst
Date: Fri, 30 Sep 94 13:45:19 jst
From: wolf@molout.tutkie.tut.ac.jp (Wolf-D. Ihlenfeldt)
Message-Id: <9409300445.AA07197@molout.tutkie.tut.ac.jp>
To: postgres@postgres.Berkeley.EDU
Subject: Tuple-Functions on variable tables ?
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Thu, 29 Sep 94 21:44:32 -0700
Resent-XMts: smtp


I need to make some pretty complicated comparisons between
tuples. The tuples may be from the same or different tables.
I defined a user function, which works fine for the tuples
it is defined for, i.e.

   my_func(class1,class2)
  
works fine if the function is defined as

  define function my_func (language = "c", returntype = bool,
   trusted="t", percall_cpu = "costly!!!")
   arg is (class1,class2) as "/path/myfunc.so"

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 ? And if this is possible, how about using 
different classes with operators bound to the functio, i.e.

  define operator = (arg1=class1,arg2=class2,procedure=my_func,
  restrict=eqsel,join=eqsel)

??

Any help is appreciated.

WDI


==============================================================================
   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.
==============================================================================
