X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 6CD28CCC4E for ; Fri, 18 Jul 2003 05:59:59 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 73642-04 for ; Fri, 18 Jul 2003 06:00:28 +0000 (GMT) Received: from sabre.velocet.net (sabre.velocet.net [216.138.209.205]) by svr1.postgresql.org (Postfix) with ESMTP id 340C6CADB4 for ; Fri, 18 Jul 2003 02:59:57 -0300 (ADT) Received: from stark.dyndns.tv (H162.C233.tor.velocet.net [216.138.233.162]) by sabre.velocet.net (Postfix) with ESMTP id DFE8113950F; Fri, 18 Jul 2003 02:00:23 -0400 (EDT) Received: from localhost ([127.0.0.1] helo=stark.dyndns.tv ident=foobar) by stark.dyndns.tv with smtp (Exim 3.36 #1 (Debian)) id 19dOI3-0001Yc-00; Fri, 18 Jul 2003 02:00:23 -0400 To: Joe Conway Cc: BenLaKnet , pgsql-sql@postgresql.org Subject: Re: Recursive request ... References: <3F0C3469.2050106@adelis.com> <200307131217.02856.mallah@trade-india.com> <3F1645BF.908@icqmail.com> <3F16E00A.6020806@joeconway.com> In-Reply-To: <3F16E00A.6020806@joeconway.com> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 18 Jul 2003 02:00:23 -0400 Message-ID: <87n0fcjrwo.fsf@stark.dyndns.tv> Lines: 24 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/246 X-Sequence-Number: 14360 Joe Conway writes: > BenLaKnet wrote: > > I see connect by in Oracle > > ??? is there an equivalent in PostgreSQL or not ?? > > Someone is working on the SQL99 equivalent, but it isn't done yet. Perhaps for > 7.5. There's a connectby hack in the contrib/tablefunc directory. I haven't used it so I'm not clear on how powerful it is compared to the real deal, but people on one of the pgsql lists seemed to find it useful when it came up in the past. connectby(text relname, text keyid_fld, text parent_keyid_fld, text start_with, int max_depth [, text branch_delim]) - returns keyid, parent_keyid, level, and an optional branch string - requires anonymous composite type syntax in the FROM clause. See the instructions in the documentation below. -- greg