I am trying to make postgres tables work like an object hierarchy. As an example I have done this.
I suspect you are barking up the wrong tree ;)
You are probably better off incorporating something like the "ltree" type to encode the taxonomy.
I haven't had a chance to leverage it myself but the concept it embodies is solid.
David J.