Skip to content

Commit

Permalink
Check SqlState instead of error message
Browse files Browse the repository at this point in the history
The PostgreSQL error messages are translated, so trying to match them against an english text might not work on different locales.
  • Loading branch information
Tobias Grimm committed Dec 26, 2024
1 parent e83e718 commit 777f7f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Weasel.Postgresql/Tables/Table.FetchExisting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private async Task readPartitionsAsync(DbDataReader reader, Table existing, Canc
}
catch (PostgresException e)
{
if (e.Message.Contains("does not exist")) return;
if (e.SqlState == "3F000") return; // 3F000 = ERRCODE_INVALID_SCHEMA_NAME
throw;
}

Expand Down

0 comments on commit 777f7f8

Please sign in to comment.