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

Document caveats around PostgreSQL exception handling #226

Closed
sheluchin opened this issue Sep 23, 2022 · 3 comments
Closed

Document caveats around PostgreSQL exception handling #226

sheluchin opened this issue Sep 23, 2022 · 3 comments
Assignees
Labels
documentation The documentation is wrong or needs improving

Comments

@sheluchin
Copy link

Hi, @seancorfield. You gave me some advice about exception handling in next.jdbc the other day on Slack and we discovered that PostgreSQL has a non-standard way of dealing with exceptions. Specifically, it doesn't use the standard SQL exception hierarchy, but just throws PSQLException. This is likely to be the case until pgjdbc/pgjdbc#1904 gets merged.

You asked me to open an issue here to remind you to mention this in the Tips and Tricks section of the docs to help any next.jdbc users which might be using or considering Postgres.

Thanks for your help!

@seancorfield seancorfield self-assigned this Oct 1, 2022
@seancorfield seancorfield added the documentation The documentation is wrong or needs improving label Oct 1, 2022
seancorfield added a commit that referenced this issue Nov 5, 2022
@seancorfield
Copy link
Owner

I dug into this a bit and the whole area is pretty vendor-specific, so I've written up a new section in Tips & Tricks that covers exception handling in general rather than try to offer database-specific advice.

@sheluchin
Copy link
Author

@seancorfield Thank you for looking into this and providing some guidance. Sounds like a complicated situation indeed, but the content you added is helpful as a basis.

@seancorfield
Copy link
Owner

Yeah, when I started reading various JDBC driver docs and experimenting in the REPL with the various ones I test against, I realized that it was way worse than our discussion on Slack suggested! 😱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation The documentation is wrong or needs improving
Projects
None yet
Development

No branches or pull requests

2 participants