Re: Trigger problem

From: Mike Rylander <miker(at)purplefrog(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Trigger problem
Date: 2004-06-08 18:57:44
Message-ID: ca52p7$2sbn$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message kasper 2004-06-08 19:38:37 Trigger problem
Previous Message Rajesh Kumar Mallah 2004-06-08 18:41:54 Re: Query becoming slower on adding a primary key