Re: after trigger question

From: "Richard Huxton" <dev(at)archonet(dot)com>
To: "Feite Brekeveld" <feite(dot)brekeveld(at)osiris-it(dot)nl>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: after trigger question
Date: 2001-03-22 12:50:15
Message-ID: 004701c0b2ce$a55e4640$1001a8c0@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From: "Feite Brekeveld" <feite(dot)brekeveld(at)osiris-it(dot)nl>

> Stephan Szabo wrote:
>
> > On Thu, 22 Mar 2001, Feite Brekeveld wrote:
> >
> > > Hi,
> > >
> > > I have put an AFTER INSERT TRIGGER on a table.
> > >
> > > If the triggerfunction fails to do an operation shouldn't the insert
> > > already have taken place ?
> >
> > It depends on what you mean by fails to do an operation. If it
> > raises an actual error the transaction is going to be rolled back so the
> > insert is effectively undone.
>
> The conversion of a timestring to an integer value fails because it is
> sometimes illegal formatted , but I would like to have the the original
> data inserted in the table as a string.

Use a BEFORE INSERT trigger then to check/translate the timestring before
you insert.

- Richard Huxton

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Francisco Sachet 2001-03-22 13:09:43
Previous Message Jonas Bengtsson 2001-03-22 12:36:24 OID as Primary Key