Closed
Description
import { parse, deparse } from 'pgsql-parser';
const sql = `MERGE INTO t AS target
USING (SELECT 1 AS id) AS source ON target.id = source.id
WHEN MATCHED THEN UPDATE SET name = 'x'
WHEN NOT MATCHED THEN INSERT (id, name) VALUES (source.id, 'x')`;
const ast = parse(sql); // succeeds
deparse(ast); // throws: does not handle node type: MergeWhenClauseThe parser handles MERGE (added in PostgreSQL 15) but the deparser has no visitor for MergeWhenClause. Tested on pgsql-deparser@17.18.2.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Merge pull request #352 from constructive-io/fix/deparser-issues-292-…
pyramation commentedon Sep 17, 2026
thanks @ivanbulanov for reporting this! A fix is coming up
pyramation commentedon Sep 17, 2026
thanks again!
#352 (comment)