On 7/24/25 05:18, sivapostg...@yahoo.com wrote:
Thanks Merlin, adrain, Laurenz

As a testcase, I split the trigger function into three, one each for insert, update, delete, each called from a separate trigger.

IT WORKS!.

It worked before, it just slowed down as your cases got bigger. You need to provide more information on what test case you used and how you define worked.


Shouldn't we have one trigger function for all the three trigger events?  Is it prohibited for bulk insert like this?

No. Triggers are overhead and they add to the processing that need to be done for moving the data into the table. Whether that is an issue is a case by case determination.


I tried this in PGAdmin only, will complete the testing from the program which we are developing, after my return from holiday.

From Merlin Moncure's post:

"* reconfiguring your logic to a procedure can be a better idea; COPY
your data into some staging tables (perhaps temp, and indexed), then
write to various tables with joins, upserts, etc."

I would suggest looking into implementing the above.


Happiness Always
BKR Sivaprakash




--
Adrian Klaver
adrian.kla...@aklaver.com


Reply via email to