From: jurka at ejurka.com (Kris Jurka) Date: Tue, 27 Dec 2011 10:10:02 -0800 Subject: [Pljava-dev] testing for equality in user-defined types in select statements In-Reply-To: References: <4EF94368.8020200@ejurka.com> Message-ID: <4EFA09FA.6000902@ejurka.com> On 12/27/2011 9:41 AM, Bear Giles wrote: > > 1) what are the two methods that are required for hash joins. I'm sure > they're related to the hashCode method but I haven't come across how to > make the link. You're still thinking about the Java side, but you really need to think about this from the postgresql side. Postgresql determines the hash function for a type by looking up it's hash operator class definition. It might be best to look at some sample opclass definitions for btree and hash to figure out how to define the ordering and hashing operations you want. Perhaps look at contrib/isn? > 2) I'm having problems defining one of my operations. The UDT is > "Rational", for rational numbers. I don't have a problem defining the > ordering operations between two rational values but I'm also trying to > define ordering operations between a Rational and a float8. > I'm not sure what's going on here. > 3) What about aggregate functions? Sum(), min(), etc. Are they just > functions that take a SETOF (sql) and array (java)? > See CREATE AGGREGATE. Kris Jurka