Paulo,
> how do you usually handle hierarchical (tree-like) queries? I'm sure someone
> else needed this already.
Yup!
Please see:
http://techdocs.postgresql.org/
... which has at least one article on trees.
Also, Joe Celko's book, SQL for Smarties ( reviewed athttp://techdocs.postgresql.org/bookreviews.php ) has chapters on
thetwo mainapproaches to tree structures in fairly exhaustive detail. Buy the book. Or,the condensed version of some
ofthat information was posted to the list byJoe Celko last summer; you can hunt for it in the archives.
-Josh Berkus
______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete
informationtechnology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small
businesses fax 621-2533 and non-profit organizations. San Francisco