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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTEs for inserts don't work #401

Open
rswheeldon opened this issue Apr 30, 2024 · 0 comments
Open

CTEs for inserts don't work #401

rswheeldon opened this issue Apr 30, 2024 · 0 comments

Comments

@rswheeldon
Copy link

Describe the bug

Trying to do an insert based on a CTE (with) and I get the following:

馃敤 Not supported 馃敤 : "WITH" nested statement with query type 'insert'

馃憠 pg-mem is work-in-progress, and it would seem that you've hit one of its limits.

*锔忊儯 Reconsituted failed SQL statement: WITH a AS (SELECT *  FROM foo   ) INSERT INTO bar   SELECT *  FROM a

馃憠 You can file an issue at https://github.com/oguimbal/pg-mem along with a way to reproduce this error (if you can), and  the stacktrace:

To Reproduce

create table foo (x integer);
create table bar (x integer);
insert into foo values (1), (2);

insert into bar select * from foo;

with a as (
    select * from foo
)
insert into bar select * from a;

First insert works but the second doesn't despite them being functionally identical (and both working in postgres 14.1

pg-mem version

2.8.1

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