Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some issues with PostgreSQL not running with an english locale #3616

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

e-tobi
Copy link
Contributor

@e-tobi e-tobi commented Dec 31, 2024

Instead of relying on exception messages, use SqlState, because exception messages might be language dependent.

Tobias Grimm added 7 commits December 30, 2024 13:04
To check for exceptions caused by a uniqueness violation, use the SqlError instead of the exception messages, which might be translated to a different locale. Also use the PostgresErrorCodes constants from Npgsql.
Exception messages get translated!
Instead of checking the exception message, check if SqlState equals PostgresErrorCodes.InFailedSqlTransaction ("25P02")
Do not check the full exception messages, if they might be translated to a non-english locale.
Check constraint name instead of exception message and make regex for details extraction more language independent.
...when trying to truncate a non-existing table.
@e-tobi e-tobi changed the title Fix some issues with PostgreSQL notr running with an english locale Fix some issues with PostgreSQL not running with an english locale Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant