Annotation: assert.fail

CREATE OR REPLACE FUNCTION assert.fail(message text)
RETURNS text

Information: assert.fail

Schema assert
Function Name fail
Arguments message text
Owner postgres
Result Type text
Description

Implementation: assert.fail

CREATE OR REPLACE FUNCTION assert.fail(message text)
 RETURNS text
 LANGUAGE plpgsql
 IMMUTABLE STRICT
AS $function$
BEGIN
    IF $1 IS NULL OR trim($1) = '' THEN
        message := 'NO REASON SPECIFIED';
    END IF;
    
    RAISE WARNING 'ASSERT FAILED : %', message;
    RETURN message;
END
$function$