> 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; ??