« Note that ASSERT is meant for detecting program bugs, not for reporting ordinary error conditions. Use the RAISE statement, described above, for that. »
But it takes quite a stretch of the imagination to infer that this means that the "assert_failure" exception cannot be handled.
Agreed. But as the pl/pgsql section “trapping errors” notes:
“The special condition name OTHERS matches every error type except QUERY_CANCELED and ASSERT_FAILURE. (It is possible, but often unwise, to trap those two error types by name.)”
i.e., you must trap it explicitly, not as part of others.
Thanks again, David. I don't yet know my way around the overall PG doc well enough to make sure that I read everything that relates to my current interest. Thanks for reminding me about this: