Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Location
    Slovakia
    Posts
    2

    Red face Unanswered: Bad functionality of before update trigger

    Hi all,
    I have installed PostgreSQL 7.3b4 version on Mandrake linux 9.0, and I have generaly problem with before update trigger functionality.
    When I have defined before update trigger on table, than update not performed succesfully. So update was performed OK, but updated values are old, they are not changed, althrough the trigger function is perform nothing. When I drop this trigger, then update performed OK and updates values are changed. Why?
    Can you help me with this problem ?

    Thanks
    Lukino

  2. #2
    Join Date
    Nov 2002
    Location
    Slovakia
    Posts
    2

    Re: Bad functionality of before update trigger

    Originally posted by Lukino
    Hi all,
    I have installed PostgreSQL 7.3b4 version on Mandrake linux 9.0, and I have generaly problem with before update trigger functionality.
    When I have defined before update trigger on table, than update not performed succesfully. So update was performed OK, but updated values are old, they are not changed, althrough the trigger function is perform nothing. When I drop this trigger, then update performed OK and updates values are changed. Why?
    Can you help me with this problem ?

    Thanks
    Lukino
    I resolve this problem, yeat.
    Before trigger function must return PointerGetDatum(trigdata->tg_newtuple), not PointerGetDatum(trigdata->tg_trigtuple) as after update triggers function, because in tg_newtuple are new updated values and tg_trigtuple are old values!

    By

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •