Skip to content

Commit 6b1bc37

Browse files
add test for VALIDATE CONSTRAINT
1 parent 7947c6a commit 6b1bc37

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/sqlparser_postgres.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6259,3 +6259,16 @@ fn parse_alter_table_constraint_not_valid() {
62596259
_ => unreachable!(),
62606260
}
62616261
}
6262+
6263+
#[test]
6264+
fn parse_alter_table_validate_constraint() {
6265+
match pg().verified_stmt("ALTER TABLE foo VALIDATE CONSTRAINT bar") {
6266+
Statement::AlterTable { operations, .. } => {
6267+
assert_eq!(
6268+
operations,
6269+
vec![AlterTableOperation::ValidateConstraint { name: "bar".into() }]
6270+
);
6271+
}
6272+
_ => unreachable!(),
6273+
}
6274+
}

0 commit comments

Comments
 (0)