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

docs/chore: Add unique constraint violation code support #1453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nickmarx12345678
Copy link

Include an additional value to represent the PostgreSQL error code for the condition unique_violation. This is used for client error handling code, similar to (I assume), OBJECT_IN_USE

Include enum value for UNIQUE_CONSTRAINT_VIOLATION PSQLState
Set value to "23505" per documentation located at: https://www.postgresql.org/docs/current/errcodes-appendix.html
This is a personal issue that I came across today when attempting to handle unique constraint based exceptions, I am trying to avoid hard coding error codes in the applications.

All Submissions:
[X ] Have you followed the guidelines in our Contributing document?
[X ] Have you checked to ensure there aren't other open Pull Requests for the same update/change?

@nickmarx12345678 nickmarx12345678 changed the title Add unique constraint violation code support docs/chore: Add unique constraint violation code support Apr 1, 2019
@AppVeyorBot
Copy link

@nickmarx12345678 nickmarx12345678 force-pushed the pmarx_add_unique_constraint_violation_code branch from 7a170a5 to 71679e1 Compare April 1, 2019 04:09
@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@codecov-io
Copy link

Codecov Report

Merging #1453 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##             master    #1453      +/-   ##
============================================
- Coverage     68.74%   68.72%   -0.02%     
+ Complexity     3903     3901       -2     
============================================
  Files           179      179              
  Lines         16414    16415       +1     
  Branches       2672     2672              
============================================
- Hits          11284    11282       -2     
- Misses         3883     3884       +1     
- Partials       1247     1249       +2

@davecramer
Copy link
Member

Since this is pretty easy to test for it would be good to add a test case as well

@nickmarx12345678
Copy link
Author

nickmarx12345678 commented Apr 1, 2019 via email

@davecramer
Copy link
Member

@nickmarx12345678 I'd love to push this, but I'd also love a test case...

@nickmarx12345678
Copy link
Author

nickmarx12345678 commented Apr 9, 2019 via email

@davecramer
Copy link
Member

That's fine, I can leave it open. I'm trying to push a release out soon so I'm doing some housekeeping. It's labeled so I'll just leave it as is. Thanks!

@arash-kamangir
Copy link

Hi :) Is there any updates?
Regards.

@vlsi vlsi force-pushed the master branch 2 times, most recently from c25d807 to adcb194 Compare March 7, 2020 20:41
@glasser
Copy link

glasser commented Apr 17, 2020

Looks fixed in #1699

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants