Chapter 39. Triggers

|  Chapter 39. Triggers  |                             |                          |                  |                                |
|:----------------------:|-----------------------------|--------------------------|------------------|--------------------------------|
|[Prev](extend-pgxs.html)|[Up](server-programming.html)|Part V. Server Programming|[Home](index.html)| [Next](trigger-definition.html)|

---

## Chapter 39. Triggers

**Table of Contents**

[39.1. Overview of Trigger Behavior](trigger-definition.html)[39.2. Visibility of Data Changes](trigger-datachanges.html)[39.3. Writing Trigger Functions in C](trigger-interface.html)[39.4. A Complete Trigger Example](trigger-example.html)

[]()

 This chapter provides general information about writing trigger functions. Trigger functions can be written in most of the available procedural languages, including PL/pgSQL ([Chapter 43](plpgsql.html)), PL/Tcl ([Chapter 44](pltcl.html)), PL/Perl ([Chapter 45](plperl.html)), and PL/Python ([Chapter 46](plpython.html)). After reading this chapter, you should consult the chapter for your favorite procedural language to find out the language-specific details of writing a trigger in it.

 It is also possible to write a trigger function in C, although most people find it easier to use one of the procedural languages. It is not currently possible to write a trigger function in the plain SQL function language.

---

|        [Prev](extend-pgxs.html)        |[Up](server-programming.html)|  [Next](trigger-definition.html)  |
|:---------------------------------------|:---------------------------:|----------------------------------:|
|38.18. Extension Building Infrastructure|     [Home](index.html)      | 39.1. Overview of Trigger Behavior|

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>