[Postgres-xl-general] Recursive CTE on replicated table?

Mason Sharp msharp at translattice.com
Wed Sep 24 07:53:35 PDT 2014


On Wed, Sep 24, 2014 at 9:16 AM, Aaron Jackson <ajackson at revionics.com>
wrote:

>    I also looked through the code and noticed the limitation on CTEs.
> The problem however is given the way they are written, I can't see a single
> recursive CTE that would work.  In particular, the moment you query against
> or join against the CTE, the parse node generates a node with a relkind
> that isn't of type RTE_JOIN or RTE_RELATION and fails.
>
>  That in and of itself makes me wonder what recursive functionality one
> could come up with.
>
>  Seems like the alternative is to write a recursive function ... much
> like the functions outlined in this link.
>
>
> http://www.postgresonline.com/journal/archives/83-Quick-Guide-to-writing-PLPGSQL-Functions-Part-3-NOTICES,-RECURSION,-and-more.html
>
>  I am curious on an academic level.  What makes the recursive CTE that I
> presented earlier an issue?
>
> For some issues, the distributed architecture means more effort to make
parallelized/distributed operations work properly. I don't recall the
particulars in this case, but in the short term we just decided to block it
until we could address it.

You are right, it probably would not be overly difficult to allow it for
replicated tables. We just blocked handling in general until we could look
into it. The error message is a bit misleading, since we block recursive
queries in general.

Thanks,


-- 
Mason Sharp

TransLattice - http://www.translattice.com
Clustered and Distributed Database Solutions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/private.cgi/postgres-xl-general-postgres-xl.org/attachments/20140924/c141f6f2/attachment.htm>


More information about the postgres-xl-general mailing list