From: jurka at ejurka.com (Kris Jurka) Date: Mon, 26 Dec 2011 20:02:48 -0800 Subject: [Pljava-dev] testing for equality in user-defined types in select statements In-Reply-To: References: Message-ID: <4EF94368.8020200@ejurka.com> On 12/26/2011 7:41 PM, Bear Giles wrote: > I have a UDT for rational numbers. I want to be able to add it in > select statements but it doesn't work. > > > select f.value, f.foo, b.bar from foo f join bar b on (f.value = > b.value); > > I vaguely recall that there were standard function names for this when I > played with C UDT years ago but that was PSQL version 5.x or 6.x. Is > that still the case? In either case the wiki should be updated. > You are looking for CREATE OPERATOR for equality/comparison and CREATE OPERATOR CLASS for ordering definition. These are no different for pljava types vs any other implemented type. Kris Jurka