Re: Trigger AFTER UPDATE OR INSERT

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: yogesh <yogesh(dot)arora(dot)daffodil(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Trigger AFTER UPDATE OR INSERT
Date: 2007-10-21 14:18:39
Message-ID: dcc563d10710210718h4c9dd9efpd81108206105b342@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 10/20/07, yogesh <yogesh(dot)arora(dot)daffodil(at)gmail(dot)com> wrote:
> On Oct 19, 11:05 pm, scott(dot)marl(dot)(dot)(dot)(at)gmail(dot)com ("Scott Marlowe") wrote:
> > Yes, it's right. Triggers are part of a transaction (or run their
> > own) so if the trigger fails, so does the transaction.
> >
> > If you really need to have something insert rather or not the
> > transaction succeeds, you can either use savepoints so that you can
> > roll back to before the error then insert the row anyway, or use
> > dblink to connect to the db through another backend and commit your
> > data that way.
> >
> > You might want to give more info on exactly what you're trying to do
> > so the folks on the list can make better informed recommendations.

> Hello Scott,
> Thanks to you....
> you got the right point point what i want to know.......
>
> are you saying about programming or any other way to done
> it........to insert a row even if the Trigger fails or succeeds

Read up on savepoints here:
http://www.postgresql.org/docs/8.2/static/sql-savepoint.html

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Anibal David Acosta 2007-10-22 01:16:11 Please help (backup)
Previous Message Mikko Partio 2007-10-21 12:15:41 Re: Continuous archiving and wal generation