Re: can you do rollback in a trigger function?

From: Vick Khera <vivek(at)khera(dot)org>
To: Quang Thoi <Quang_Thoi(at)symantec(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: can you do rollback in a trigger function?
Date: 2013-10-15 19:00:10
Message-ID: CALd+dcdtMQgJx6t8paVYBswHE2mDd8hQLJYO02A0V36Mwgr2jA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Oct 15, 2013 at 2:38 PM, Quang Thoi <Quang_Thoi(at)symantec(dot)com> wrote:

> I want to roll back deletion if there is a reference (FK) in another table.
> ****
>
> Can I explicitly call a rollback inside a function?
>

You should RAISE an error. The transaction should roll back due to the
error.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shaun Thomas 2013-10-15 19:18:29 Re: can you do rollback in a trigger function?
Previous Message Quang Thoi 2013-10-15 18:38:35 can you do rollback in a trigger function?