From 6b1bc3716aea2c8c9405f731a0867f5a0340ec69 Mon Sep 17 00:00:00 2001 From: achristmascarl Date: Wed, 25 Jun 2025 14:58:52 -0400 Subject: [PATCH] add test for VALIDATE CONSTRAINT --- tests/sqlparser_postgres.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/sqlparser_postgres.rs b/tests/sqlparser_postgres.rs index 680553c6..4e03c124 100644 --- a/tests/sqlparser_postgres.rs +++ b/tests/sqlparser_postgres.rs @@ -6259,3 +6259,16 @@ fn parse_alter_table_constraint_not_valid() { _ => unreachable!(), } } + +#[test] +fn parse_alter_table_validate_constraint() { + match pg().verified_stmt("ALTER TABLE foo VALIDATE CONSTRAINT bar") { + Statement::AlterTable { operations, .. } => { + assert_eq!( + operations, + vec![AlterTableOperation::ValidateConstraint { name: "bar".into() }] + ); + } + _ => unreachable!(), + } +}