Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> schrieb:

> Thank you but I must inc an specific row. How to do that ?

Read the answer again.

Please, no silly TOFU (german synonym for text above, fullquote below).

> >> For example. I have a table with a field that on each update it
> >> incrementes a field that is allways configured to 0 before the
> >> starting of updates.
> >Something like:
> >CREATE FUNCTION my_autoinc() RETURNS TRIGGER AS $$
> >BEGIN
> >     NEW.counter := NEW.counter + 1;
> >     RETURN NEW;
> >END;
> >$$ LANGUAGE plpgsql;
> >CREATE TRIGGER my_counter_trig BEFORE UPDATE ON my_table
> >FOR EACH ROW EXECUTE PROCEDURE my_autoinc();

Your task is only to adapt this to your table-design.


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to