Return-Path: aoki
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA15961; Fri, 25 Jun 93 07:46:02 -0700
Message-Id: <9306251446.AA15961@postgres.Berkeley.EDU>
From: aoki@postgres.berkeley.edu (Paul M. Aoki)
Subject: Re: define operator
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
In-Reply-To: Your message of Fri, 25 Jun 93 11:33:56 MESZ 
	     <9306250938.AA14995@postgres.Berkeley.EDU> 
Date: Fri, 25 Jun 93 07:48:16 -0700
Sender: aoki@postgres.Berkeley.EDU
X-Mts: smtp

Wolf Guddat <guddat@faps.uni-erlangen.de> writes:
> define operator ++ (arg1 = MYTYPE, procedure = my_func )
> -- How will the backend know if it is a right-unary or a left-unary operator?

this is a problem that avi pfeffer fixed a couple of months ago.
the new "define operator" man page says, for a right-unary, define 
arg1, for a left-unary, define arg2, and for a binary, define both.
it would make more sense if "arg1" and "arg2" were named "leftarg"
and "rightarg" or something..

> Consulting the system-catalog pg_operator shows the mistake.
> -- How can a left-unary operator have a left operand and no right operand?

you're exactly right.  it's been like that back to the dawn of time
(or the beginning of the RCS history, same thing :-)  goes to show 
how many people define unary operators.. anyway, avi fixed this as well.

with respect to unary +: i think this is a crock in the grammar.
the only valid single-character operator names appear to be: ~!@#%^&`?
e.g., you can't define a new single-character operator with +-*/=<> ..
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki
