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

materialized CTEs don't work #407

Open
rswheeldon opened this issue Jun 18, 2024 · 0 comments
Open

materialized CTEs don't work #407

rswheeldon opened this issue Jun 18, 2024 · 0 comments

Comments

@rswheeldon
Copy link

Describe the bug

Common Table Expressions (CTEs) or "with" blocks are supported by postgres and pg-mem. See https://www.postgresql.org/docs/current/queries-with.html for background

The materialized keyword has significant impacts on performance in real postgres databases but SQL with that in fails to parse in pg-mem

💀 Syntax error at line 4 col 13:

  with bar as materialized
              ^
Unexpected word token: "materialized". Instead, I was expecting to see one of the following:

    - A "lparen" token

To Reproduce

create table foo (x integer, y integer);
insert into foo values (1,2), (4,5);
with bar as ( select * from foo ) select * from bar;
with bar as materialized ( select * from foo ) select * from bar;

Penultimate line works fine. Adding the materialized keyword breaks it.

pg-mem version

2.8.1 (also fails in playground at time of writing)

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

1 participant