Triggers and SPI, oh my! - Mailing list pgsql-general

From Joel Dudley
Subject Triggers and SPI, oh my!
Date
Msg-id A04BDD2C264AD41181C000508BDCB72AB83793@usazdolexch0.developonline.home
Whole thread Raw
List pgsql-general
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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Multiple pq_flush: send() failed: Broken pipe
Next
From: Bruce Momjian
Date:
Subject: Re: Re: Does PostgreSQL support EXISTS?