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

Update IntegrityError pattern for PostgreSQL 13. #518

Merged
merged 1 commit into from
Jun 5, 2021

Conversation

jchristgit
Copy link
Member

A more specific error is raised on higher PostgreSQL versions, for example, as
with the PostgreSQL version running on my local machine. This commit fixes the
error message pattern matching behaviour by adding an optional match to the
detailed error message.

A more specific error is raised on higher PostgreSQL versions, for example, as
with the PostgreSQL version running on my local machine. This commit fixes the
error message pattern matching behaviour by adding an optional match to the
detailed error message.
@jchristgit jchristgit added the area: tests Related to `unittest` tests label Jun 4, 2021
@jchristgit jchristgit requested a review from MarkKoz June 4, 2021 21:09
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 8633eaa on update-integrity-pattern-for-postgresql-13 into 7d81829 on main.

Copy link
Member

@MarkKoz MarkKoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we would not rely on comparing message strings, but there doesn't seem to be any other source of information that is more stable. At best, we might be able to get an error code, but still wouldn't know the column name.

https://github.com/psycopg/psycopg2/blob/master/lib/errorcodes.py#L236

@jchristgit jchristgit requested a review from kosayoda June 5, 2021 09:39
@kosayoda kosayoda merged commit a9df3b0 into main Jun 5, 2021
@kosayoda kosayoda deleted the update-integrity-pattern-for-postgresql-13 branch June 5, 2021 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tests Related to `unittest` tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants