Thread: Function for Exception Logging
Hi community,
I would like to implement a function that would log managed Exceptions into a dedicated table.
For example, I have some code like :
BEGIN
Code generation exception
EXCEPTION
WHEN OTHERS THEN Log_Error();
END;
The Log_Error function would be able to get the exception context / parameters to log the exception parameters into a table.
Is there any way to manage this without providing the Exception parameters as parameters to the Log_Error function ?
Thanks,
Patrick
Patrick Fiche
Database Engineer, Aqsacom Sas.
c. 33 6 82 80 69 96
Attachment
Hi community,
I would like to implement a function that would log managed Exceptions into a dedicated table.
For example, I have some code like :
BEGIN
Code generation exception
EXCEPTION
WHEN OTHERS THEN Log_Error();
END;
The Log_Error function would be able to get the exception context / parameters to log the exception parameters into a table.
Is there any way to manage this without providing the Exception parameters as parameters to the Log_Error function ?
Thanks,
Patrick
Patrick Fiche
Database Engineer, Aqsacom Sas.
c. 33 6 82 80 69 96
Attachment
> Even more difficult in PG functions as they have no commit / rollback > capability. I haven't played with stored procedures in in PG11 yet. You can simulate oracle autonomous transaction feature in postgres by connecting to the same db using dblink. As for implicit passing of error parameters, I don't think it's possible. Best, Alex