-
Notifications
You must be signed in to change notification settings - Fork 684
PostgreSQL: ALTER USER password option #2142
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
Conversation
| /// ALTER USER [ IF EXISTS ] [ <name> ] [ OPTIONS ] | ||
| /// ``` | ||
| /// | ||
| /// [Snowflake](https://docs.snowflake.com/en/sql-reference/sql/alter-user) |
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.
It seems we dropped this doc reference, could we add it back together with the new pg reference?
| } | ||
| verified_stmt("ALTER USER u1 SET DEFAULT_SECONDARY_ROLES=('ALL'), PASSWORD='secret', WORKLOAD_IDENTITY=(TYPE=AWS, ARN='arn:aws:iam::123456789:r1/')"); | ||
|
|
||
| verified_stmt("ALTER USER u1 PASSWORD 'AAA'"); |
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.
can we add test cases for ENCRYPTED and PASSWORD NULL?
src/parser/alter.rs
Outdated
| if self.parse_keyword(Keyword::NULL) { | ||
| Some(AlterUserPassword { | ||
| encrypted, | ||
| password: None, | ||
| }) | ||
| } else { | ||
| let password = self.parse_literal_string()?; | ||
| Some(AlterUserPassword { | ||
| encrypted, | ||
| password: Some(password), | ||
| }) | ||
| } |
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.
minor probably to clarify the code, we could do e.g.
let password = if self.parse_keyword(Keyword::NULL) {
None
} else {
Some(self.parse_literal_string()?)
};
Some(AlterUserPassword {
encrypted,
password,
})4d6ec1f to
cbbd106
Compare
cbbd106 to
9df7e3d
Compare
No description provided.