Search Postgresql Archives

Re: Preventing an 'after' trigger from causing rollback on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 13, 2012 at 3:58 PM, Eliot Gable
<egable+pgsql-general@xxxxxxxxx> wrote:
> Is there any way I can stop a trigger which fires after a row is inserted
> into a table from causing a rollback of the entire transaction if something
> goes wrong?

Take look here:

http://www.postgresql.org/docs/9.0/static/plpgsql-porting.html

Specifically the part about:

BEGIN
        INSERT INTO cs_jobs (job_id, start_stamp) VALUES (v_job_id, now());
    EXCEPTION
        WHEN unique_violation THEN (2)
            -- don't worry if it already exists
    END;

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux