Skip to content

Conversation

@7ttp
Copy link
Contributor

@7ttp 7ttp commented Jan 21, 2026

Summary

Parser incorrectly treats atomic substring in identifiers as BEGIN ATOMIC keyword, causing migration failures.

Problem

Migrations with table/column names containing atomic fail with:
ERROR: cannot insert multiple commands into a prepared statement (SQLSTATE 42601)

Example:

create table public.atomic_test (id int);
select 1;

Root cause: Parser matches atomic in identifiers as the BEGIN ATOMIC keyword, enters a state where semicolons are ignored, and merges multiple statements into one.

Solution

Added word boundary check: ATOMIC only recognized as keyword when preceded by whitespace.
This prevents false matches in identifiers while preserving correct BEGIN ATOMIC function body handling.

Related

@7ttp 7ttp requested a review from a team as a code owner January 21, 2026 20:24
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.

Database migration fails on local server when table or column name contains 'atomic'

1 participant