Re: Triggers - Mailing list pgsql-general

From Oliver Elphick
Subject Re: Triggers
Date
Msg-id 1029506424.28779.564.camel@linda
Whole thread Raw
In response to Triggers  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Responses Re: Triggers
List pgsql-general
On Fri, 2002-08-16 at 14:42, Jean-Christian Imbeault wrote:
> I have a with a a column defined as not null. The value however can be
> found by looking it up in another table. I would like to create a
> trigger that after insert would look up the need value and put it in the
> record being inserted.
>
> Unfortunately the column is defined as not null so I fear the insert
> would fail and the trigger never get called. How can I get around this?

Surely you can use a BEFORE trigger, can't you?

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "And whatsoever ye shall ask in my name, that will I
      do, that the Father may be glorified in the Son."
                                          John 14:13


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: writing own cast
Next
From: "Peter Gibbs"
Date:
Subject: Re: Triggers