@@ -10371,32 +10371,30 @@ impl<'a> Parser<'a> {
1037110371 } else if self.parse_keywords(&[Keyword::VALIDATE, Keyword::CONSTRAINT]) {
1037210372 let name = self.parse_identifier()?;
1037310373 AlterTableOperation::ValidateConstraint { name }
10374+ } else if dialect_of!(self is PostgreSqlDialect | GenericDialect)
10375+ && self.parse_keywords(&[Keyword::SET, Keyword::LOGGED])
10376+ {
10377+ AlterTableOperation::SetLogged
10378+ } else if dialect_of!(self is PostgreSqlDialect | GenericDialect)
10379+ && self.parse_keywords(&[Keyword::SET, Keyword::UNLOGGED])
10380+ {
10381+ AlterTableOperation::SetUnlogged
1037410382 } else {
10375- if dialect_of!(self is PostgreSqlDialect | GenericDialect)
10376- && self.parse_keywords(&[Keyword::SET, Keyword::LOGGED])
10377- {
10378- AlterTableOperation::SetLogged
10379- } else if dialect_of!(self is PostgreSqlDialect | GenericDialect)
10380- && self.parse_keywords(&[Keyword::SET, Keyword::UNLOGGED])
10381- {
10382- AlterTableOperation::SetUnlogged
10383+ let mut options =
10384+ self.parse_options_with_keywords(&[Keyword::SET, Keyword::TBLPROPERTIES])?;
10385+ if !options.is_empty() {
10386+ AlterTableOperation::SetTblProperties {
10387+ table_properties: options,
10388+ }
1038310389 } else {
10384- let mut options =
10385- self.parse_options_with_keywords(&[Keyword::SET, Keyword::TBLPROPERTIES])?;
10390+ options = self.parse_options(Keyword::SET)?;
1038610391 if !options.is_empty() {
10387- AlterTableOperation::SetTblProperties {
10388- table_properties: options,
10389- }
10392+ AlterTableOperation::SetOptionsParens { options }
1039010393 } else {
10391- options = self.parse_options(Keyword::SET)?;
10392- if !options.is_empty() {
10393- AlterTableOperation::SetOptionsParens { options }
10394- } else {
10395- return self.expected_ref(
10396- "ADD, RENAME, PARTITION, SWAP, DROP, REPLICA IDENTITY, SET, or SET TBLPROPERTIES after ALTER TABLE",
10397- self.peek_token_ref(),
10398- );
10399- }
10394+ return self.expected_ref(
10395+ "ADD, RENAME, PARTITION, SWAP, DROP, REPLICA IDENTITY, SET, or SET TBLPROPERTIES after ALTER TABLE",
10396+ self.peek_token_ref(),
10397+ );
1040010398 }
1040110399 }
1040210400 };
0 commit comments