X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 62DE1D1B4E5 for ; Wed, 8 Oct 2003 19:51:30 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 31675-08 for ; Wed, 8 Oct 2003 16:50:46 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id B237AD1B4E9 for ; Wed, 8 Oct 2003 16:50:44 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h98JoiQh011333 for ; Wed, 8 Oct 2003 19:50:44 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h98Jbrj2009505 for pgsql-sql@postgresql.org; Wed, 8 Oct 2003 19:37:53 GMT From: "Thomas Wegner" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Oracle 'connect by prior' now eaiser in 7.3? Date: Wed, 8 Oct 2003 21:38:00 +0200 Organization: Hub.Org Networking Services Lines: 55 Message-ID: References: <3F6FC51F.6090105@joeconway.com> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/150 X-Sequence-Number: 15550 Hello, i have a table like this: CREATE TABLE "public"."WINUSER" ( "ID_WINUSER" INTEGER NOT NULL, "STATUS" INTEGER NOT NULL, "CUSTOMERID" VARCHAR(8) NOT NULL, "CUSTOMERPW" VARCHAR(100) NOT NULL, "EMAIL" VARCHAR(100) NOT NULL, "REF_ID_WINUSER" INTEGER, PRIMARY KEY("ID_WINUSER"), ) WITH OIDS; and will get the tree from this to fields: "ID_WINUSER" INTEGER NOT NULL, "REF_ID_WINUSER" INTEGER, i write this sql: SELECT "ID_WINUSER" FROM connectby('"WINUSER"', '"ID_WINUSER"', '"REF_ID_WINUSER"', 4, 0, '~') AS t("ID_WINUSER" integer) and get this error: ERROR: Query-specified return tuple not valid for Connectby: wrong number of columns How is the correct use of connectby() for me? ------------------------------------------ Thomas Wegner "Joe Conway" schrieb im Newsbeitrag news:3F6FC51F.6090105@joeconway.com... > Merrall, Graeme wrote: > > Am I right in thinking that recursive procedures and procs returning row > > sets would allow us to better emulate this behaviour? As anyone looked > > at it yet? > > > > See connectby() in contrib/tablefunc. Someone was working on SQL99 > recursive queries but it didn't get done for 7.4 -- perhaps it will be > in 7.5. In the meantime, connectby() is in 7.3 and might work for you. > > HTH, > > Joe > > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend >