Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btxoQ-0001jN-0C for pgsql-general@arkaria.postgresql.org; Tue, 11 Oct 2016 14:13:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1btxoP-0007Fb-El for pgsql-general@arkaria.postgresql.org; Tue, 11 Oct 2016 14:13:45 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1btxoO-0007FV-UF for pgsql-general@postgresql.org; Tue, 11 Oct 2016 14:13:45 +0000 Received: from [195.159.176.226] (helo=blaine.gmane.org) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1btxoJ-0000JA-IV for pgsql-general@postgresql.org; Tue, 11 Oct 2016 14:13:43 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1btxo3-0007A2-R2 for pgsql-general@postgresql.org; Tue, 11 Oct 2016 16:13:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-general@postgresql.org From: Lele Gaifax Subject: Re: Create recursive view schema.name Date: Tue, 11 Oct 2016 16:12:58 +0200 Organization: Nautilus Entertainments Lines: 26 Message-ID: <87wphfx9cl.fsf@metapensiero.it> References: <871sznz69m.fsf@metapensiero.it> <25887.1476193573@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@blaine.gmane.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:vBpi5dUUcfi73YCWfMeiFecv0is= X-Host-Lookup-Failed: Reverse DNS lookup failed for 195.159.176.226 (failed) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Tom Lane writes: > The manual says > CREATE RECURSIVE VIEW name (columns) AS SELECT ...; > is equivalent to > CREATE VIEW name AS WITH RECURSIVE name (columns) AS (SELECT ...) SELECT columns FROM name; > > I guess it could be more explicit about the fact that the implied CTE just > has the base name of the view; but since CTE names can't be qualified, > that's not that hard to guess. Short answer is that you don't qualify the > view's internal self-reference, even if you are using a schema name in the > CREATE. Thank you Tom, it works. I agree with you that the doc could/should be fixed/enhanced, because the explanation of "name" is immediately following the snippet you cited, and it says "The name (optionally schema-qualified) of a view to be created": it would never occurred to me that I could use a not-qualified name within the view. bye, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. lele@metapensiero.it | -- Fortunato Depero, 1929. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general