Re: Trigger problem - Mailing list pgsql-sql

From Mike Rylander
Subject Re: Trigger problem
Date
Msg-id ca52p7$2sbn$1@news.hub.org
Whole thread Raw
In response to Trigger problem  ("kasper" <no@spam.com>)
Responses Re: Trigger problem
List pgsql-sql
kasper wrote:

> Hi guys
> 
> 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;

The line above is using the SQL equaliy opperator, you want the assignment
operator:
 :=

as in 
       new.changed := true;

>         return new;
>     end;
> ' language 'plpgsql';
> 
> create trigger myTrigger
> after update on lektioner
> for each row
> execute procedure myFunction();
> 
> 
> the code compiles, runs, and doesnt whine about anything, but nothing
> changes...
> 
> any ideas??
> 
> - Kasper

-miker



pgsql-sql by date:

Previous
From: "kasper"
Date:
Subject: Trigger problem
Next
From: Stephan Szabo
Date:
Subject: Re: Trigger problem