Mooncake-Labs / pg_mooncake

Iceberg/Delta Columnstore Table in Postgres
http://mooncake.dev
MIT License
228 stars 12 forks source link

Lockdown MERGE INTO #31

Closed dpxcc closed 4 days ago

dpxcc commented 1 week ago

What happens?

Postgres MERGE INTO is not supported by DuckDB

To Reproduce

CREATE TABLE s (a INT) USING columnstore;
INSERT INTO s VALUES (1), (2), (3);

CREATE TABLE t (a INT, b INT) USING columnstore;
INSERT INTO t VALUES (0), (1);

MERGE INTO t USING s ON t.a = s.a
WHEN MATCHED THEN UPDATE SET b = s.a + 1
WHEN NOT MATCHED BY SOURCE THEN DELETE
WHEN NOT MATCHED BY TARGET THEN INSERT VALUES (s.a, s.a + 1);

throws

ERROR:  (PGDuckDB/CreatePlan) Prepared query returned an error: 'Parser Error: syntax error at or near "MERGE"
LINE 1: MERGE INTO pgmooncake.public.t USING pg...

A better lockdown message should be shown here

OS:

Linux

pg_mooncake Version:

35f6563

Postgres Version:

17.0

Are you using pg_mooncake Docker, Neon, or the extension standalone?

pg_mooncake extension standalone