Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WITH RECURSIVE not implemented #42

Closed
patrickgaskill opened this issue Jan 29, 2019 · 5 comments
Closed

WITH RECURSIVE not implemented #42

patrickgaskill opened this issue Jan 29, 2019 · 5 comments

Comments

@patrickgaskill
Copy link

From the docs: https://www.postgresql.org/docs/9.1/queries-with.html

Trying to fumpt this:

WITH RECURSIVE included_parts(sub_part, part, quantity) AS (
    SELECT sub_part, part, quantity FROM parts WHERE part = 'our_product'
  UNION ALL
    SELECT p.sub_part, p.part, p.quantity
    FROM included_parts pr, parts p
    WHERE p.part = pr.sub_part
  )
SELECT sub_part, SUM(quantity) as total_quantity
FROM included_parts
GROUP BY sub_part

results in unimplemented at or near "select"

Removing RECURSIVE will let it format successfully.

@maddyblue
Copy link
Owner

This is because cockroach doesn't support RECURSIVE. See cockroachdb/cockroach#21085.

@tilinna
Copy link

tilinna commented Mar 11, 2019

The same happens with lateral joins.

Do you know if there are plans to extend cockroach's SQL parser ahead of the actually supported PostgreSQL features? Just enough to support the formatting part.

Anyway, thanks for the great work! :)

@maddyblue
Copy link
Owner

The current cockroach parser doesn't make that kind of support easy, and we haven't done that in the past. We would like to, though, and have a similar project in mind. We will consider this need in the future.

@tilinna
Copy link

tilinna commented Apr 16, 2020

RECURSIVE is now supported so perhaps this issue can be closed?

@maddyblue
Copy link
Owner

Built and redeployed on master. This works now. Thanks for the prompt!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants