X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9D6A7533A0 for ; Sun, 3 Apr 2005 20:57:32 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 43398-07 for ; Sun, 3 Apr 2005 19:57:30 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 773725339B for ; Sun, 3 Apr 2005 20:57:28 +0100 (BST) Received: (qmail 16208 invoked from network); 3 Apr 2005 21:57:48 +0200 Received: from unknown (HELO localhost) (boutiquenumerique-lists@192.168.0.4) by boutiquenumerique.com with SMTP; 3 Apr 2005 21:57:48 +0200 To: "Oleg Bartunov" , "Axel Straschil" Cc: pgsql-sql@postgresql.org Subject: Re: How to store directory like structures? References: Message-ID: Date: Sun, 03 Apr 2005 21:57:29 +0200 From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Opera M2(BETA2)/8.0 (Linux, build 987) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/35 X-Sequence-Number: 20928 > you need to load ltree into your database ! > psql yourdb < ltree.sql > > use 'locate ltree.sql' to find if ltree is installed Yeah, I remember now having to do that, but the binary module definitely was here without having to do anything besides "emerge postgresql" : peufeu@nyuu peufeu $ locate ltree.so /usr/lib/postgresql/ltree.so peufeu@nyuu peufeu $ locate ltree.sql /usr/share/postgresql/contrib/ltree.sql So just : psql yourdb < /usr/share/postgresql/contrib/ltree.sql And you should be OK. Really this module is amazing. You can put a trigger on the table so that, for instance, the path is created automatically from the element name and the parent_id, that kind of things. I remember search was also really fast and you can use complex queries without CONNECT BY...