Thread: Triggers and SPI, oh my!

Triggers and SPI, oh my!

From
Joel Dudley
Date:
Hello all,
  We are writing a trigger in C that is somewhat like a replication trigger.
It needs to know if data is inserted, updated, or deleted from a particular
table. When the data changes, it must be able to get these changes and write
them to a file. We have been using SPI to get the tuple information when the
data changes, but we are having a problem with inserts. I can't seem to
figure out how to get inserted data from a C trigger. Here is the scenario.
When data is inserted into a table, the trigger must be able to get the
inserted data and write it to a file. How can a C trigger get a hold of data
from an insert?  Thanks in advance for your comments.

Joel Dudley
Unix Admin
DevelopOnline.com