Re: Trigger question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nelio Alves Pereira Filho <nelio(at)ifx(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trigger question
Date: 2000-11-27 17:03:25
Message-ID: 11210.975344605@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Nelio Alves Pereira Filho <nelio(at)ifx(dot)com(dot)br> writes:
> create trigger set_counter after insert or update on nivel
> for each row execute procedure set_counter();

> The problem is that after I insert something, count value is still -1,
> not 0!

You want a BEFORE trigger, not an AFTER trigger. AFTER is too late
to affect the contents of the stored row.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nelio Alves Pereira Filho 2000-11-27 17:08:36 Re: Trigger question
Previous Message Nelio Alves Pereira Filho 2000-11-27 16:23:20 Trigger question