I need to ignore an error when running a procedure, but the error still seems to propagate. Is it possible to just swallow it somehow?
CREATE OR REPLACE PROCEDURE myproc()
AS $$
BEGIN
EXECUTE 'bad_statement;';
EXCEPTION WHEN OTHERS THEN
NULL;
END;
$$ LANGUAGE plpgsql;
Then
call myproc();
will result in:
[2021-01-06 17:08:42] [42601][500310] Amazon Invalid operation: syntax error at or near "bad_statement";
Tested it in postgres and it ignores the error correctly.