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.


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to