One of the simplest ways to do it is with plProxy call into same database in
exception block.
Get plproxy installed in your database and after that it is as simple as
function call.
test=# create table log ( msg text );
CREATE TABLE
test=# create function add_logg ( i_msg text ) returns void as $$
Hello,
I write funktions in pl/pgsql and want to abort it. For this I use raise
exception, to undo all changes for this transaction. Now I want to log
these exceptions somewhere.
DECLARE
a integer;
log_id integer;
BEGIN
SELECT a INTO b FROM c WHERE d = 10;
IF NOT FOUND THEN
INSERT INT