Skip to content

fix: accept identity RESTART values without WITH - #2677

Open
minleejae wants to merge 1 commit into
JSQLParser:masterfrom
minleejae:fix/identity-restart-value
Open

minleejae wants to merge 1 commit into
JSQLParser:masterfrom
minleejae:fix/identity-restart-value

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

Accept the optional-WITH form ALTER TABLE t ALTER COLUMN id RESTART 20, reusing the existing signed sequence-value parser and IdentityAlteration AST. Both spellings expose getRestartWith() and render consistently as RESTART WITH 20; a null value continues to represent bare RESTART.

Add withRestartWith for direct construction, document the value semantics, and cover editing, signed values, adjacent identity operations, multi-action ALTER and default/POSTGRESQL parsing. This common grammar correction preserves the existing RESTART WITH behavior.

Validation: full Gradle check on Java 17; original and rendered DDL executed on PostgreSQL 18, followed by an INSERT verifying that the next generated identity value is 20.

Syntax reference: https://www.postgresql.org/docs/18/sql-altertable.html

Signed-off-by: minleejae <mmj9808@gmail.com>
@minleejae
minleejae force-pushed the fix/identity-restart-value branch from 7529865 to 73be752 Compare September 22, 2026 09:38
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.

1 participant