Skip to content

Commit

Permalink
fix: glaredb table drop
Browse files Browse the repository at this point in the history
  • Loading branch information
aljazerzen committed Sep 6, 2024
1 parent 8007dfd commit 41b02fd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions connector_arrow/src/postgres/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ impl SchemaEdit for super::PostgresConnection {

match res {
Ok(_) => Ok(()),
Err(e)
if matches!(e.code(), Some(&SqlState::UNDEFINED_TABLE)) ||
// GlareDB will return such errors
e.as_db_error().map_or(false, |e| {
e.message().starts_with("Error during planning: Table ")
&& e.message().ends_with(" does not exist")
}) =>
{
Err(TableDropError::TableNonexistent)
}
Err(e) if matches!(e.code(), Some(&SqlState::UNDEFINED_TABLE)) => {
Err(TableDropError::TableNonexistent)
}
Expand Down

0 comments on commit 41b02fd

Please sign in to comment.