Re: Trigger question - Mailing list pgsql-novice

From Pat Marchant
Subject Re: Trigger question
Date
Msg-id 20011220224726.GA18149@lvcablemodem.com
Whole thread Raw
In response to Re: Trigger question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Thanks for the reply.

I was hoping to avoid using C. Am I correct about
my assumption that having, say, 30 IF..END IF blocks
in one trigger is more efficient (in terms of
execution speed and server load) than 5 update
triggers per table?

I'm just wondering if it's worth the effort to do it
in C or just use lots of plpgsql triggers.

Pat Marchant

On Thu, Dec 20, 2001 at 06:31:47PM -0500, Tom Lane wrote:
> Pat Marchant <patmarchant@lvcablemodem.com> writes:
> > if (AttributeExists(new.updated))
> >    { new.updated = 'now'::datetime;}
>
> I don't know any good way to do this in plpgsql.  It'd be moderately
> straightforward in C, however, since you could look at the tuple
> descriptor for the relation to see if there is a field named updated.
>

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Using a tablename as a parameter to a function.
Next
From: denis@coralindia.com
Date:
Subject: concating numeric with text