Trigger question

From: Nelio Alves Pereira Filho <nelio(at)ifx(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: Trigger question
Date: 2000-11-27 16:23:20
Message-ID: 3A228A77.78E42FCC@ifx.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there.

I'm trying to use triggers for the first time, but I'm having some
problems.

Here's my SQL:

create function set_counter()
returns opaque
as 'BEGIN
new.count := 0;
RETURN new;
END;'
language 'plpgsql';

create trigger set_counter after insert or update on nivel
for each row execute procedure set_counter();

count is an int, and its default value is -1.

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

Could someone tell me what's wrong?

Thanks

--
Nelio Alves Pereira Filho
IFX Networks
Sao Paulo / Brazil

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-11-27 17:03:25 Re: Trigger question
Previous Message Tom Lane 2000-11-27 16:14:28 Re: PL/Perl on Solaris