You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FORMATTING] PostgreSQL: MERGE (PostgreSQL 15+) is not recognized #986
PostgreSQL has supported MERGE since version 15, but the postgresql dialect does not seem to know the statement: merge, matched and insert stay lower case with keywordCase: 'upper', and the clauses are not laid out the way MERGE is in plsql, transactsql or bigquery.
Input data
merge into stock as t using incoming as s ont.sku=s.sku when matched then updateset qty =s.qty when not matched then insert (sku, qty) values (s.sku, s.qty);
Expected Output (roughly what other dialects produce)
MERGE INTO
stock AS t USING incoming AS s ONt.sku=s.sku
WHEN MATCHED THEN
UPDATESET
qty =s.qty
WHEN NOT MATCHED THEN
INSERT
(sku, qty)
VALUES
(s.sku, s.qty);
Actual Output
merge INTO stock AS t USING incoming AS s ONt.sku=s.sku WHEN matched THEN
UPDATESET
qty =s.qty WHEN NOT matched THEN insert (sku, qty)
VALUES
(s.sku, s.qty);
Activity