> Looks like something for ltree, which is a datatype for storing > tree-structured data. > > http://projects.commandprompt.com/public/pgsql/browser/trunk/pgsql/contrib/ltree/README.ltree Unfourtunately, ltree seems to compare node labels in lexicographic order: "have their usual meanings. Comparison is doing in the order of direct tree traversing, children of a node are sorted lexicographic." Maybe it is possible to hack it to support numeric order, but that would mean I'd introduce a new non-approoved patch that users of my application would have to apply to their database in order to run my application. Since my application is vaguely security related, that is a big non-no - I need to keep dependencies and code simple and easy to get an overview of and review...