Skip to content

fix(postgresql): format SELECT INTO as a separate clause - #1003

Closed
obaseyi2 wants to merge 2 commits into
sql-formatter-org:masterfrom
obaseyi2:fix/postgresql-select-into-clause
Closed

obaseyi2 wants to merge 2 commits into
sql-formatter-org:masterfrom
obaseyi2:fix/postgresql-select-into-clause

Conversation

@obaseyi2

@obaseyi2 obaseyi2 commented Oct 23, 2026 •

Copy link
Copy Markdown

Addresses #864 for PostgreSQL.

SELECT id INTO new_users FROM users currently appends INTO new_users to the selected expression. Recognize PostgreSQL's INTO [TEMPORARY | TEMP | UNLOGGED] [TABLE] as a clause so the target starts on its own line. Existing INSERT INTO handling is unchanged.

Tests cover all eight modifier combinations, idempotence and keyword case. The nine new regression cases failed before the fix.

Validation on the published head: 27 Jest suites passed (5,894 tests passed, 1 skipped, 63 snapshots); repository-wide formatting, lint, type checking and CJS/ESM/webpack builds passed.

Local validation used Windows/Node 24 and separately installed tooling without lockfile changes; CI uses Node 22. This is not an upstream CI result.

@nene

nene commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

I'm adopting a new policy for this repository: no AI-generated contributions. I don't care how good they are.

This is to preserve my sanity.

@nene nene closed this Oct 29, 2026
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.

2 participants