mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-08 01:15:00 +00:00
Postgresql: Add REPLICA IDENTITY
operation for ALTER TABLE
(#1844)
This commit is contained in:
parent
74a95fdbd1
commit
c6e897dc12
5 changed files with 80 additions and 2 deletions
|
@ -5959,3 +5959,30 @@ fn parse_varbit_datatype() {
|
|||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_alter_table_replica_identity() {
|
||||
match pg_and_generic().verified_stmt("ALTER TABLE foo REPLICA IDENTITY FULL") {
|
||||
Statement::AlterTable { operations, .. } => {
|
||||
assert_eq!(
|
||||
operations,
|
||||
vec![AlterTableOperation::ReplicaIdentity {
|
||||
identity: ReplicaIdentity::Full
|
||||
}]
|
||||
);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
||||
match pg_and_generic().verified_stmt("ALTER TABLE foo REPLICA IDENTITY USING INDEX foo_idx") {
|
||||
Statement::AlterTable { operations, .. } => {
|
||||
assert_eq!(
|
||||
operations,
|
||||
vec![AlterTableOperation::ReplicaIdentity {
|
||||
identity: ReplicaIdentity::Index("foo_idx".into())
|
||||
}]
|
||||
);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue