[Pljava-dev] testing for equality in user-defined types in select statements

From: jurka at ejurka(dot)com (Kris Jurka)
To:
Subject: [Pljava-dev] testing for equality in user-defined types in select statements
Date: 2011-12-27 18:10:02
Message-ID: 4EFA09FA.6000902@ejurka.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

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

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Bear Giles 2011-12-30 03:48:17 [Pljava-dev] one static method disappearing when second one is defined?!
Previous Message Bear Giles 2011-12-27 17:41:56 [Pljava-dev] testing for equality in user-defined types in select statements