Trigger difference in 9.0 and 9.3

From: Erwan Tanajaya <erwan(dot)tanajaya(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Trigger difference in 9.0 and 9.3
Date: 2014-09-08 08:14:25
Message-ID: CAF=3GYt7fwJZq1Z--T_hMofEU=pSoQR7upp_swAu2yET35JXuQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi All,

how i write this trigger in postgresql 9.3 in postgresql 9.0 it is running
well

i had transaction header and transaction detail table
I had trigger on after detail table inserted, updated, or deleted it update
value on header table
when header is deleted i had trigger that run in before delete event to
delete the detail table.

i need header run in before event because when detail is deleted(or update
and insert) and the trigger is running i need selecting data from header.

now in postgresql 9.3 i get this error "tuple to be updated was already
modified by an operation triggered by current command", it running well in
9.0

there is hint that said "Consider using an AFTER trigger instead of a
before trigger to propagate changes to other row", i cannot use after
trigger because i need selecting data from header when detail trigger is
fired.

any idea how i should do this on postgresql 9.3

Best Regards,
Erwan Tanajaya

Sorry for my bad english

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2014-09-08 14:28:19 Re: Trigger difference in 9.0 and 9.3
Previous Message wschnell 2014-09-08 00:00:03 string is too long for tsvector