-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements ALTER POLICY syntax for PostgreSQL #1446
Conversation
```sql ALTER POLICY name ON table_name RENAME TO new_name ALTER POLICY name ON table_name [ TO { role_name | PUBLIC | CURRENT_ROLE | CURRENT_USER | SESSION_USER } [, ...] ] [ USING ( using_expression ) ] [ WITH CHECK ( check_expression ) ] ``` For the documentation, please refer: https://www.postgresql.org/docs/current/sql-alterpolicy.html
753df07
to
5232492
Compare
Pull Request Test Coverage Report for Build 11091759958Details
💛 - Coveralls |
cc @iffyio |
src/parser/alter.rs
Outdated
let to = if self.parse_keyword(Keyword::TO) { | ||
Some(self.parse_comma_separated(|p| p.parse_owner())?) | ||
} else { | ||
None | ||
}; | ||
|
||
if self.parse_keyword(Keyword::RENAME) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from the doc it looks like the RENAME
vs others are are mutually exclusive, so that if we parse a TO
it probably won't be correct to potentially also parse a rename afterwards as the current code suggests?
e.g ALTER POLICY a on t TO owner RENAME TO new_name
seems like its accepted by the parser?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iffyio Yes, you're right. I falsely parsed TO before REANME, will fix it soon. Thank you for your correction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! cc @alamb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Andrew Lamb <[email protected]>
…parser-rs into feature/alter-policy-for-pg
I merged up from main to resolve a conflict |
@alamb Thank you! |
🚀 |
For the documentation, please refer:
https://www.postgresql.org/docs/current/sql-alterpolicy.html