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 31D8A3A3BA5 for ; Tue, 16 Nov 2004 12:57:58 +0000 (GMT) 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 05665-09 for ; Tue, 16 Nov 2004 12:57:41 +0000 (GMT) Received: from rock.spider.ru (rock.spider.ru [62.183.34.226]) by svr1.postgresql.org (Postfix) with ESMTP id 81F0D3A1D98 for ; Tue, 16 Nov 2004 12:57:43 +0000 (GMT) Received: from rock (localhost [127.0.0.1]) by rock (Postfix) with SMTP id E44212B30C; Tue, 16 Nov 2004 15:57:39 +0300 (MSK) Received: from sad.localnet.ru (sad.localnet.ru [10.0.0.72]) by rock.spider.ru (Postfix) with ESMTP id 05156274B3; Tue, 16 Nov 2004 15:57:34 +0300 (MSK) Content-Type: text/plain; charset="iso-8859-1" From: sad Organization: IT To: Gary Stainburn , pgsql-sql@postgresql.org Subject: Re: tree structure photo gallery date quiery Date: Tue, 16 Nov 2004 16:08:17 +0300 User-Agent: KMail/1.4.3 References: <200411161129.46131.gary.stainburn@ringways.co.uk> In-Reply-To: <200411161129.46131.gary.stainburn@ringways.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200411161608.18040.sad@bankir.ru> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/143 X-Sequence-Number: 19462 On Tuesday 16 November 2004 14:29, Gary Stainburn wrote: > Hi folks. > > I'm looking at the possibility of implementing a photo gallery for my > web site with a tree structure > How would I go about creating a view to show a) the number of photos in > a gallery and b) the timestamp of the most recent addition for a > gallery, so that it interrogates all sub-galleries? nested-tree helps you associate a numeric interval [l,r] with each record of a tree and let father interval include all its children intervals and brother intervals never intersect see the article http://sf.net/projects/redundantdb for detailed examples and templates