> I think you should have a look at the ltree contrib package. It
> implements tree-like structures, and probably makes your problem much
> simpler.
I have never used contrib modules with PostgreSQL - are they easy to
handle - I mean, especially upon upgrade, etc.