Skip to content

Support MERGE in PostgreSQL - #1001

Closed
zzoraemon043 wants to merge 1 commit into
sql-formatter-org:masterfrom
zzoraemon043:fix/postgres-merge
Closed

zzoraemon043 wants to merge 1 commit into
sql-formatter-org:masterfrom
zzoraemon043:fix/postgres-merge

Conversation

@zzoraemon043

Copy link
Copy Markdown

Fixes #986

Adds the same MERGE clauses the other dialects use to postgresql: MERGE [INTO], WHEN [NOT] MATCHED [BY SOURCE | BY TARGET] [THEN] (BY SOURCE / BY TARGET are PostgreSQL 17) and UPDATE SET. INSERT INTO becomes INSERT [INTO] so the bare INSERT (cols) inside MERGE is a clause, and MERGE_ACTION() is added to the function list for RETURNING merge_action().

The shared supportsMergeInto test now runs for PostgreSQL too.

@nene

nene commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Dear @zzoraemon043, why do you open a pull request for an issue which already has an open pull request? And why do so for multiple pull requests?

Maybe you want to propose a better solution? I don't know. Given the amount of pull requests I'm getting lately, I'm inclined to just close this without further thought.

@zzoraemon043

Copy link
Copy Markdown
Author

sorry missed #993 and #995 closing this one and #1000

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

Successfully merging this pull request may close these issues.

[FORMATTING] PostgreSQL: MERGE (PostgreSQL 15+) is not recognized

2 participants