Skip to content

Postgres constraint NOT VALID and VALIDATE CONSTRAINT #1908

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

achristmascarl
Copy link

closes #1907

Handles creating constraints with NOT VALID, as well as ALTER TABLE table VALIDATE CONSTRAINT constraint

@@ -8477,7 +8477,14 @@ impl<'a> Parser<'a> {
pub fn parse_alter_table_operation(&mut self) -> Result<AlterTableOperation, ParserError> {
let operation = if self.parse_keyword(Keyword::ADD) {
if let Some(constraint) = self.parse_optional_table_constraint()? {
AlterTableOperation::AddConstraint(constraint)
let mut not_valid = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For both this flag and the new validate constraint clause, can we can skip the dialect methods and have the parser always accept the syntax if it shows up in a statement? since the syntax doesn't look like it conflicts with other dialects

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.

Postgres NOT VALID and VALIDATE CONSTRAINT not parsed for ALTER TABLE
2 participants