O'Reilly logo

PostgreSQL Server Programming by Jim Mlodgenski, Kirk Roybal, Hannu Krosing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fast capturing of database changes

Some obvious things to code in C are logging, or auditing triggers, which get called at each INSERT, UPDATE, or DELETE to a table. We have not set aside enough space in this book to explain everything needed for C triggers, but interested reader could look up the source code for the skytools package where you can find more than one way to write triggers in C.

The highly optimized C source for the two main triggers, logtriga and logutriga, includes everything you need to capture these changes to a table and even detecting table structure changes while the code is running.

The latest source code for skytools can be found at http://pgfoundry.org/projects/skytools.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required