Search Postgresql Archives

Re: Is "WITH RECURSIVE" limited to the first position of CTEs by design?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"David G. Johnston" <david.g.johnston@xxxxxxxxx> writes:
> On Mon, Nov 13, 2023 at 9:17 AM Kirk Wolak <wolakk@xxxxxxxxx> wrote:
>> These are the most trivial examples.  The second one results in a syntax
>> error.  Which implies that:
>> 1) There can only be one recursive CTE at the same level?
>> 2) It must be the FIRST CTE?

> There is only one WITH keyword as well, that doesn't change the fact there
> can be multiple attached queries to it.

Yeah, RECURSIVE is attached to the WITH not to the query.  That's
because it has global implications for the visibility of the CTE
names across all the CTEs in the WITH.

			regards, tom lane





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux