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 INTO log (logtype, logtext) VALUES ('error', 'Dit not found 10 in table') RETURNING id INTO log_id; RAISE EXCEPTION 'internal_error: %', log_id; END IF; -- anything else END; I know that these logs well be discard, if the commit rolls back. Is there a possible way to implement something like this? Thanks, Gerhard
Attachment:
signature.asc
Description: Digital signature