Received: from ece.rice.edu (ece.rice.edu [128.42.4.34]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7EFdEP53811 for ; Tue, 14 Aug 2001 11:39:14 -0400 (EDT) (envelope-from reedstrm@rice.edu) Received: from wallace.ece.rice.edu (wallace.ece.rice.edu [128.42.12.154]) by ece.rice.edu (Postfix) with ESMTP id ACA3568A5E; Tue, 14 Aug 2001 10:39:05 -0500 (CDT) Received: from reedstrm by wallace.ece.rice.edu with local (Exim 3.22 #1 (Debian)) id 15WgDT-00048c-00; Tue, 14 Aug 2001 10:34:51 -0500 Date: Tue, 14 Aug 2001 10:34:51 -0500 From: "Ross J. Reedstrom" To: Alan Gutierrez Cc: Bill , pgsql-sql@postgresql.org Subject: Re: Re: DateDiff, IsNull? Message-ID: <20010814103451.A15790@rice.edu> Mail-Followup-To: "Ross J. Reedstrom" , Alan Gutierrez , Bill , pgsql-sql@postgresql.org References: <9lb25o$psq$1@news.tht.net> Mime-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.3.18i X-Archive-Number: 200108/192 X-Sequence-Number: 4417 On Tue, Aug 14, 2001 at 06:51:33AM +0000, Alan Gutierrez wrote: > > Overloading operators? *Please* tell me that this is impossible. Well, Alan, overloading operators is sort of important to the user definable types in postgresql. And any cross-type functionality, actually. Bill's original question was looking for 'text1' + 'text2' to mean concatentation. The right (SQL92) spelling for that is: 'text1' || 'text2' Currently, since there is no '+' operator for the types 'text' and 'text', you probably could define it as a synonym for ||. I wouldn't expect your code to be very portable that way, but it might work. (BTW, as written above, with string constants (type 'unknown'), the type promotion system kicks in and turns the strings into 'char', I believe, which it then adds the raw values of the first character, and produces 'æ' (sorry about the 8-bit character)) Check the manuals for 'CREATE OPERATOR', then grovel through the pg_operator table to figure out what all you'd need to hand it for procedure names, etc. Ross