Repository navigation
PostgreSQL: parse CREATE GROUP and DROP GROUP - #2429
Open
LucaCappelletti94 wants to merge 4 commits into
Open
LucaCappelletti94 wants to merge 4 commits into
LucaCappelletti94 wants to merge 4 commits into
Conversation
LucaCappelletti94
marked this pull request as ready for review
August 5, 2026 14:13
LucaCappelletti94
force-pushed
the
pg-create-drop-group
branch
2 times, most recently
from
August 24, 2026 11:52
a81ad93 to
eb95863
Compare
LucaCappelletti94
force-pushed
the
pg-create-drop-group
branch
from
September 3, 2026 17:05
eb95863 to
0dc690e
Compare
LucaCappelletti94
force-pushed
the
pg-create-drop-group
branch
4 times, most recently
from
September 22, 2026 21:20
12418e2 to
bc8d980
Compare
LucaCappelletti94
added a commit
to LucaCappelletti94/sqlparser-rs
that referenced
this pull request
Oct 2, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2429 +/- ##
==========================================
+ Coverage 81.52% 81.57% +0.04%
==========================================
Files 42 42
Lines 34205 34244 +39
Branches 34205 34244 +39
==========================================
+ Hits 27885 27933 +48
+ Misses 2770 2758 -12
- Partials 3550 3553 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
pg-create-drop-group
branch
from
October 2, 2026 16:15
f391d2c to
931d7f3
Compare
LucaCappelletti94
force-pushed
the
pg-create-drop-group
branch
3 times, most recently
from
October 17, 2026 01:00
2ed5332 to
a99e919
Compare
LucaCappelletti94
force-pushed
the
pg-create-drop-group
branch
from
October 18, 2026 14:11
a99e919 to
ddda956
Compare
sabir-akhadov-localstack
approved these changes
Oct 19, 2026
sabir-akhadov-localstack
left a comment
Contributor
There was a problem hiding this comment.
One non-blocking comment inline.
| &mut self, | ||
| role_keyword: RoleKeyword, | ||
| ) -> Result<CreateRole, ParserError> { | ||
| let if_not_exists = matches!(role_keyword, RoleKeyword::Role) |
Contributor
There was a problem hiding this comment.
PostgreSQL rejects IF NOT EXISTS for CREATE ROLE too, so this guard only makes the two spellings diverge: CREATE GROUP IF NOT EXISTS g now takes IF as the group name and fails with Expected: end of statement, found: NOT. Either drop the guard to keep parity with ROLE, or reject it with an explicit error.
Contributor
Author
There was a problem hiding this comment.
Now it rejects consistently in both cases
LucaCappelletti94
force-pushed
the
pg-create-drop-group
branch
from
October 21, 2026 07:48
31663d7 to
06ba236
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PostgreSQL accepts
GROUPwherever it acceptsROLEin these two statements, but the parser rejected it, so a schema dump containingCREATE GROUPcould not be read at all.The keyword is preserved rather than rewritten to
ROLE. It looks like a pure alias in PostgreSQL, but Amazon Redshift has user groups as objects distinct from roles, so folding the two would change what the statement means there.I will also add
ALTER GROUPin a following PR, so as to keep this one smaller.