Closed sheluchin closed 1 year ago
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.
@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.
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! 😱
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 https://github.com/pgjdbc/pgjdbc/pull/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!