1

Is there any circumstance where an exception will not be thrown if an insert statement in a stored procedure fails?

I'm using catch-all style exception handling in my PostgreSQL stored procedures via EXCEPTION WHEN OTHERS THEN. I'm wondering if that's sufficient to catch all failed inserts.

1 Answer 1

3

That should cover it.
I quote the manual on Trapping Errors in PL/pgSQL:

The special condition name OTHERS matches every error type except QUERY_CANCELED. (It is possible, but often unwise, to trap QUERY_CANCELED by name.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.