I wander what a proper implementation af SETS
in a relational db would look like.

In my app, i need
a) Tree structures
b) Sets

With postgresql i wrote some views,rules
and pg/plsql functions, that work as a
"driver" for the sets.
E.G, i have a single table, with which i implement
my sets.
I dont know the number or size of sets in advance.

All i want to do is
void add(elem1,elem2)
boolean InSameSet(elem1,elem2)
Listofelemes AllInsameSet(element)

Imagine we have to cluster people in
"sister" sets, cousin stes, same color sets etc...

Also an issue is the implementation of Trees.
I read the thread
about Tree Structures in Dbforums

and i'd like to know if somebody has done any
generic SETS or generic tree implementation.