Re: Trigger question

From: Pat Marchant <patmarchant(at)lvcablemodem(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Trigger question
Date: 2001-12-20 22:47:26
Message-ID: 20011220224726.GA18149@lvcablemodem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)lvcablemodem(dot)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.
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Philip Hallstrom 2001-12-20 23:12:20 Re: FW: Random Selection from TABLE
Previous Message Stephen Ingram 2001-12-20 22:45:31 Using a tablename as a parameter to a function.