From: | joseph speigle <joesp(at)sirfsup(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: trigger not firing |
Date: | 2007-02-26 10:26:01 |
Message-ID: | 20070226102601.GA13119@www.sirfsup.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
> >
> > hello novice list,
> > can somebody show me where my mistake is with this trigger.
> > everything is fine, but they don't fire......
> >
> > ---------------------------------------------------------------------
> >
> > CREATE FUNCTION qp_question_moddate() RETURNS OPAQUE
> > AS '
> > BEGIN
> >
> > NEW.moddate := current_date;
> > RETURN NEW;
> > END;
> > ' LANGUAGE 'plpgsql';
> >
> > create trigger qp_question_moddate_update after update on qp_question
> > for each row execute procedure qp_question_moddate();
>
> After triggers are too late for modifying NEW (since the record is already
> created or changed), you'd need to make it a before trigger.
great, thank you
--
joe speigle
www.sirfsup.com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2007-02-26 17:51:33 | Re: postgresql-server-8.2.3-1mdv2007.1.i586.rpm installation problem |
Previous Message | Piotr Przeworski | 2007-02-26 09:26:59 | postgresql-server-8.2.3-1mdv2007.1.i586.rpm installation problem |