PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16405
PG Version10.0
OSAWS Aurora
Opened2020-04-30 16:07:35+00
Reported byJacob Crell
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16405
Logged by:          Jacob Crell
Email address:      (redacted)
PostgreSQL version: 10.0
Operating system:   AWS Aurora
Description:        

Create below function to return assertion failue:
CREATE OR REPLACE FUNCTION assert_fail()
RETURNS void
LANGUAGE plpgsql
AS $function$
BEGIN
    ASSERT FALSE, 'Assertion Failed';
END;
$function$;

Create this function to call above function and catch error:
CREATE OR REPLACE FUNCTION catch_assert_fail()
RETURNS text
LANGUAGE plpgsql
AS $function$
BEGIN
   SELECT * FROM meta.assert_fail();
   RETURN 'Function Finished';
   EXCEPTION WHEN OTHERS THEN
        RETURN 'Hit the Other exception block';
END;
$function$;

Run below to call function
SELECT * FROM catch_assert_fail()

Excepted Behavior: P0004 exception is caught in EXCEPTION WHEN OTHERS,
function returns text 'Hit the Other exception block'.
Actual Behavior: P0004 exception is raised and remains uncaught.

Messages

DateAuthorSubject
2020-04-30 16:07:35+00PG Bug reporting formBUG #16405: Exception P0004 not caught in EXCEPTION WHEN OTHERS
2020-04-30 17:04:25+00Tom LaneRe: BUG #16405: Exception P0004 not caught in EXCEPTION WHEN OTHERS
2020-04-30 17:15:32+00Jacob CrellRe: BUG #16405: Exception P0004 not caught in EXCEPTION WHEN OTHERS