pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lele Gaifax <lele@metapensiero.it>
To: pgsql-general@postgresql.org
Subject: Re: Create recursive view schema.name
Date: Tue, 11 Oct 2016 16:12:58 +0200
Message-ID: <87wphfx9cl.fsf@metapensiero.it> (raw)
References: <871sznz69m.fsf@metapensiero.it>
	<25887.1476193573@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

Tom Lane <tgl@sss.pgh.pa.us> 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



view thread (3+ messages)

Message-ID: <87wphfx9cl.fsf@metapensiero.it>
Permalink:  ../87wphfx9cl.fsf@metapensiero.it/
Also on:    postgresql.org/message-id/87wphfx9cl.fsf@metapensiero.it

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: lele@metapensiero.it
  Subject: Re: Create recursive view schema.name
  In-Reply-To: <87wphfx9cl.fsf@metapensiero.it>
  References: <871sznz69m.fsf@metapensiero.it> <25887.1476193573@sss.pgh.pa.us> <87wphfx9cl.fsf@metapensiero.it>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox