Re: [GENERAL] Logging in function with exception

2008-11-10 Thread Asko Oja
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 $$

[GENERAL] Logging in function with exception

2008-11-10 Thread Gerhard Heift
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