Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 8CE8E9FB999 for ; Mon, 14 May 2007 17:12:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 45353-05 for ; Mon, 14 May 2007 17:12:21 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.248]) by postgresql.org (Postfix) with ESMTP id 552AA9FB73E for ; Mon, 14 May 2007 17:12:23 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id d17so445799and for ; Mon, 14 May 2007 13:12:22 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DY8jRtKBWAjhYK1QiNpUarYZqShGT+PGG/nENqVO0c+BYxX/18aLHhfZCHUyjEvmCkNIgeqiA80YF9crRxizd0gaQFlLJ6Cg0NYDeMSU/4UaEwb6xcAcKSt8/miU4ncIpSqME7kmvlW+7gejYxDOQ3Ko4DAdwDIfNsV5rShQzac= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=S6s4swWGLAIg99Fgu7dwkPcyxpXHcp3UT/QavxeHJXC6tbqJatkVvraiTfnom25UOu2u9hAfKcdEe6JiBe74xhP5Jx4BZhFwqGS2Y2Ig99ujgIRzNMWxYyt7Sc6lYGe+nUCAlnpYhOFJrisPftGPRxY6IQLc8FF0xrQwUIYWpgc= Received: by 10.100.210.10 with SMTP id i10mr4819319ang.1179173538503; Mon, 14 May 2007 13:12:18 -0700 (PDT) Received: by 10.100.154.9 with HTTP; Mon, 14 May 2007 13:12:18 -0700 (PDT) Message-ID: Date: Mon, 14 May 2007 15:12:18 -0500 From: "=?ISO-8859-1?Q?Rodrigo_De_Le=F3n?=" To: pgsql-sql@postgresql.org Subject: Re: How to retrieve a n-ary tree in SQL? Cc: "Joost Kraaijeveld" In-Reply-To: <1179165731.4936.4.camel@panoramix> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1179165731.4936.4.camel@panoramix> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/109 X-Sequence-Number: 28389 On 5/14/07, Joost Kraaijeveld wrote: > Is there a way to get a query (of function) to retrieve a n-ary tree: 1 > parent node has n children and the tree is n levels deep? See: http://search.postgresql.org/search?q=tree&m=1&l=4&d=365&s=r