Skip to content

Accept CREATE SEQUENCE options in any order - #2414

Open
LucaCappelletti94 wants to merge 1 commit into
apache:mainfrom
LucaCappelletti94:pg-create-sequence-unordered-options
Open

Accept CREATE SEQUENCE options in any order#2414
LucaCappelletti94 wants to merge 1 commit into
apache:mainfrom
LucaCappelletti94:pg-create-sequence-unordered-options

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

CREATE SEQUENCE options were parsed by a fixed chain of independent if blocks, one per option, so only a single order was accepted. CREATE SEQUENCE s INCREMENT BY 1 START WITH 1 parsed, but CREATE SEQUENCE s START WITH 1 INCREMENT BY 1 left the INCREMENT keyword unconsumed and failed with Expected: end of statement. PostgreSQL treats these as an unordered list.

Therefore, following the same pattern we used in other methods, parse_create_sequence_options now loops, dispatching on whichever option keyword comes next and breaking when none matches, and rejects repeated options. Options are recorded in the order written, so Display round-trips the input unchanged.

@LucaCappelletti94 LucaCappelletti94 changed the title Accept CREATE SEQUENCE options in any order Accept CREATE SEQUENCE options in any order Jul 30, 2026
@LucaCappelletti94
LucaCappelletti94 marked this pull request as ready for review July 30, 2026 16:29
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