I find high quality Nested Set (or Nested Interval) source code and
I know this question gets asked a lot. To illustrate the point, here is just
one thread from each of the last five years:
Luckily, no one has asked this question yet in 2006. :-)
I've been scouring the Net for a while now, but I hope there are more
resources out there that I haven't stumbled onto yet. Here's what I've found
* Static Hierarchies and Binary Fractions in PostgreSQL, by Michael Glaesemann
This is the most complete out-of-the-box solution I've found. It uses binary
fractions and nested intervals (well, Manfred Koizar says its more of a
Materialized Path model). Lots of handholding, documentation, and functions
for everything you would want to do to a tree. Limited to 61 nodes in the
first branch, plus other limitations.
* Modified "m-vgID method", by OpenACS
Reported to support 2^31 nodes per level, uses bitstring encoding.
* m-vgID method, by Miguel Sofer
Uses base 159 encoding (all latin1 chars).
* Joe Celko's SQL for Smarties: Advanced SQL Programming, 2nd Edition
Highly recommended book. Joe also has a few articles and mailing list posts
floating around the web:
To be clear, I'm not looking for an adjacency model, materialized path model,
contrib/ltree, or connect by. Other resources that have been helpful:
Maybe all this would make a good project on pgfoundry.
Daniel Browning - Kavod Technologies. Random Fortune:
To Perl, or not to Perl, that is the kvetching.
-- Larry Wall in <199801200310.TAA11670@wall.org>