Thanks, but it solve just part of the problem. In oracle insert statement executes and rejected rows are inserted in error log table in same transaction. But, its similar feature or workaround seems hard in postgresql.
On Fri, Aug 6, 2021, 5:52 PM <066ce286@xxxxxxx> wrote:
> Hi all,
> I am porting oracle procedures into postgresql code and some oracle
> procedure contain error log table and save exception code. I could
> not find any equivalent of it in postgresql.
>
>
> Please help if any pointer or lead to its solution.
Something like :
<..>
EXCEPTION
WHEN OTHERS THEN
GET STACKED DIAGNOSTICS l_errno=RETURNED_SQLSTATE, l_errtext=MESSAGE_TEXT, l_errctx=PG_EXCEPTION_CONTEXT;
PERFORM TRACE_ERROR(l_errno,l_errtext,l_errctx );
RAISE EXCEPTION 'ERREUR %\n%\n%\nStackTrace : %',l_errno,l_errtext,l_errctx;
END;
$$ LANGUAGE PLPGSQL;
??