mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-12-23 11:12:51 +00:00
Postgres: Support parenthesized SET options for ALTER TABLE (#1947)
Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
This commit is contained in:
parent
2ed2cbe291
commit
f49c30feb6
4 changed files with 53 additions and 4 deletions
|
|
@ -4728,6 +4728,34 @@ fn parse_alter_table() {
|
|||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
||||
let set_storage_parameters = "ALTER TABLE tab SET (autovacuum_vacuum_scale_factor = 0.01, autovacuum_vacuum_threshold = 500)";
|
||||
match alter_table_op(verified_stmt(set_storage_parameters)) {
|
||||
AlterTableOperation::SetOptionsParens { options } => {
|
||||
assert_eq!(
|
||||
options,
|
||||
[
|
||||
SqlOption::KeyValue {
|
||||
key: Ident {
|
||||
value: "autovacuum_vacuum_scale_factor".to_string(),
|
||||
quote_style: None,
|
||||
span: Span::empty(),
|
||||
},
|
||||
value: Expr::Value(test_utils::number("0.01").with_empty_span()),
|
||||
},
|
||||
SqlOption::KeyValue {
|
||||
key: Ident {
|
||||
value: "autovacuum_vacuum_threshold".to_string(),
|
||||
quote_style: None,
|
||||
span: Span::empty(),
|
||||
},
|
||||
value: Expr::Value(test_utils::number("500").with_empty_span()),
|
||||
}
|
||||
],
|
||||
);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue