Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1BE2DB5DC2A for ; Tue, 20 Sep 2011 11:15:04 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 61743-03 for ; Tue, 20 Sep 2011 14:14:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from nm29.bullet.mail.bf1.yahoo.com (nm29.bullet.mail.bf1.yahoo.com [98.139.212.188]) by mail.postgresql.org (Postfix) with SMTP id 35CB8B5DC1B for ; Tue, 20 Sep 2011 11:14:57 -0300 (ADT) Received: from [98.139.212.149] by nm29.bullet.mail.bf1.yahoo.com with NNFMP; 20 Sep 2011 14:14:57 -0000 Received: from [98.139.212.232] by tm6.bullet.mail.bf1.yahoo.com with NNFMP; 20 Sep 2011 14:14:57 -0000 Received: from [127.0.0.1] by omp1041.mail.bf1.yahoo.com with NNFMP; 20 Sep 2011 14:14:57 -0000 X-Yahoo-Newman-Id: 230141.39120.bm@omp1041.mail.bf1.yahoo.com Received: (qmail 86000 invoked from network); 20 Sep 2011 14:14:57 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:References:Mime-Version:In-Reply-To:X-Apple-Yahoo-Original-Message-Folder:Content-Type:Content-Transfer-Encoding:Message-Id:Cc:X-Mailer:From:X-Apple-Yahoo-Replied-Msgid:Subject:Date:To; b=6ZGiwSZ1Y1IuKBuw0exS2KD7czNenz+M+gtB9KSvM5E88+QUY5PTu7OvyDqAImgHCSr6Ja9ObHIlDo9crRk+86NDcF39UQFbhGEL1uZ3t+qiQ94020SoVbqe8w/H2W0mf74FldSmnOwYSelWD2ze237dFySu4DatxTbZ91aqUJA= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1316528097; bh=a3PZhutE8IEG2V9eEwwHEqTmCJJjvGEDkDPNEqYTtFs=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:References:Mime-Version:In-Reply-To:X-Apple-Yahoo-Original-Message-Folder:Content-Type:Content-Transfer-Encoding:Message-Id:Cc:X-Mailer:From:X-Apple-Yahoo-Replied-Msgid:Subject:Date:To; b=CPYhJNzkpaeUlrnN8w3FENrf7wwS5rWcv2NXbv6utb7qKHnrdMInXkK0c580wAof+qnB0zk2VErEy0WO2o3CfozAG/3YfEUQaO0B4U4dpnTmgGhNDhYpTzeK/AETchK2jpKkVw0mdjWPfo3TEn+4xc5/V4o82I/DcfnDe+NoPnE= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: vOURnqoVM1l.tiVFnq88WI6kQftr.tSObibDXfkAbf8lgB5 vAbvfffnuNrR..uwIbBZYrBpMokEolRH8bdwcW.iQc5PzCzfrN1jAgVlzf94 tnv7nL5zzlthvF94sEn7OUrUnBjPApeln9q6RyPSnxKQKJTHxkPE6tTcKULy AmMj1YwJF_NoFRwiZXYruwz06nr_IOSaAKwm1P1275sRN6QqmJF1Vf5YafS9 7ucAWbsQtJy6sIQ0AY.tgHPdXg_kbBMxU_Ce.ERT3o4W5D277ahaEoVF3pVH HJIS6PFmtHb4xjrGAEMHDGTcArtla3HlQYPUCwDe0nvsea94YP2yVqg.Rsf. 5kB2D9lcYRiYwNiiIqfB1CO_TU8HUb69Y3i9mwXj4aASMl4L4tuaoQkaK79Y kbXtuUgI- X-Yahoo-SMTP: mpGJl6eswBD2IBufoVEg0Pa8gg-- Received: from [192.12.17.102] (polobo@24.93.23.188 with xymcookie) by smtp113-mob.biz.mail.bf1.yahoo.com with SMTP; 20 Sep 2011 07:14:56 -0700 PDT References: Mime-Version: 1.0 (iPad Mail 8J2) In-Reply-To: X-Apple-Yahoo-Original-Message-Folder: Inbox Content-Type: multipart/alternative; boundary=Apple-Mail-5-1065970163 Content-Transfer-Encoding: 7bit Message-Id: <1E5EC0E1-13DB-4346-B8EE-212F4DC4CCEA@yahoo.com> Cc: "pgsql-sql@postgresql.org" X-Mailer: iPad Mail (8J2) From: David Johnston X-Apple-Yahoo-Replied-Msgid: 1_64390_AO2kiGIAAYZpTnhjuQ6PvjmZQOs Subject: Re: Combining several CTEs with a recursive CTE Date: Tue, 20 Sep 2011 10:15:01 -0400 To: Thomas Kellerer X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.402 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/55 X-Sequence-Number: 35855 --Apple-Mail-5-1065970163 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Sep 20, 2011, at 5:58, Thomas Kellerer wrote: >=20 > I'm just wondering if this is intended behavioury, simply not (yet) implem= ented or even invalid according to the standard? I didn't find any reference= that it's not allowed in the manual. >=20 > Regards > Thomas >=20 >=20 Try sticking the recursive keyword after the "with" if any of the following C= TEs are recursive. =20 WITH RECURSIVE=20 normal1 AS () ,recursine1 AS () ,normal2 AS () ,recursine2 AS () SELECT ... David J.= --Apple-Mail-5-1065970163 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=utf-8
On Sep 20, 2011, at 5:58, Thomas Kellerer <spam_eater@gmx.net> wrote:


I'm just wondering if this is intended behavioury, simply not (yet) implemented or even invalid according to the standard? I didn't find any reference that it's not allowed in the manual.

Regards
Thomas



Try sticking the recursive keyword after the "with" if any of the following CTEs are recursive.  

WITH RECURSIVE 
normal1 AS ()
,recursine1 AS ()
,normal2 AS ()
,recursine2 AS ()
SELECT ...

David J.
--Apple-Mail-5-1065970163--