Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 87B2A632315 for ; Wed, 7 Apr 2010 05:34:41 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 98565-06 for ; Wed, 7 Apr 2010 08:34:30 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mail.postgresql.org (Postfix) with ESMTP id BDE7B6310AC for ; Wed, 7 Apr 2010 05:34:29 -0300 (ADT) Received: from smadev.internal.net (localhost [127.0.0.1]) by smadev.internal.net (8.14.2/8.14.2) with ESMTP id o378YQmM054175 for ; Wed, 7 Apr 2010 11:34:26 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.14.2/8.14.2/Submit) id o378YPki054174 for pgsql-sql@postgresql.org; Wed, 7 Apr 2010 11:34:25 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: pgsql-sql@postgresql.org Subject: Re: Table Design for Hierarchical Data Date: Wed, 7 Apr 2010 10:34:24 +0200 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201004071134.25176.achill@matrix.gatewaynet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201004/21 X-Sequence-Number: 33948 =CE=A3=CF=84=CE=B9=CF=82 Wednesday 07 April 2010 11:26:29 =CE=BF/=CE=B7 Ser= gey Konoplev =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > On 6 April 2010 21:33, Lee Hachadoorian wrot= e: > > More generally, what questions should I be asking to help decide what > > structure makes the most sense? Are there any websites, forums, or books > > that cover this kind of problem? >=20 > Haven't you thought about ltree contrib? From the description of > ltree: "This module implements a data type ltree for representing > labels of data stored in a hierarchical tree-like structure". >=20 > http://www.postgresql.org/docs/8.4/interactive/ltree.html Thats definitely worth checking out. Personally i didn't follow this apprach cause it seemd a little bit more re= stricting than doing it my way. However, for this case especially, it looks like it solves a photograph of = the original problem of this therad. Besides, the authors of this fine contrib module are the same known Postgre= SQL contributors of tsearch2, postgresql FTS, intarray (which i heavily use for the tree rep= resentation), etc... >=20 >=20 > --=20 > Sergey Konoplev >=20 > Blog: http://gray-hemp.blogspot.com / > Linkedin: http://ru.linkedin.com/in/grayhemp / > JID/GTalk: gray.ru@gmail.com / Skype: gray-hemp / ICQ: 29353802 >=20 =2D-=20 Achilleas Mantzios