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
import{parse,deparse}from'pgsql-parser';constsql=`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')`;constast=parse(sql);// succeedsdeparse(ast);// throws: does not handle node type: MergeWhenClause
The parser handles MERGE (added in PostgreSQL 15) but the deparser has no visitor for MergeWhenClause. Tested on pgsql-deparser@17.18.2.
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)