From: | Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> |
---|---|
To: | kasper <no(at)spam(dot)com> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Trigger problem |
Date: | 2004-06-09 20:30:30 |
Message-ID: | 20040609132740.F93111@megazone.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Tue, 8 Jun 2004, kasper wrote:
> Im tryint to make a trigger that marks a tuble as changed whenever someone
> has updated it
>
> my table looks something like this
>
> create table myTable (
> ...
> changed boolean;
> )
>
> now ive been working on a trigger and a sp that looks like this, but it
> doesnt work...
>
> create function myFunction returns trigger as '
> begin
> new.changed = true;
> return new;
> end;
> ' language 'plpgsql';
>
> create trigger myTrigger
> after update on lektioner
> for each row
> execute procedure myFunction();
You want a before update trigger if you want to update the new row like
that.
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Wieck | 2004-06-10 01:44:36 | Re: Trigger problem |
Previous Message | Jodi Kanter | 2004-06-09 17:30:40 | search and replace |