Postgresql 中文操作指南

Chapter 39. Triggers

Table of Contents

本章介绍了有关编写触发器函数的信息。触发器函数可以使用大多数可用的程序设计语言编写,包括 PL/pgSQL ( Chapter 43 )、PL/Tcl ( Chapter 44 )、PL/Perl ( Chapter 45 ) 和 PL/Python ( Chapter 46 )。在阅读此章节后,您应该查阅您最喜爱的程序设计语言的章节,以了解用该语言编写触发器的特定于语言的详细信息。

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), PL/Tcl (Chapter 44), PL/Perl (Chapter 45), and PL/Python (Chapter 46). 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.

使用 C 编写触发器函数也是可行的,尽管大多数人会发现使用某种程序设计语言更容易。目前,无法使用简单的 SQL 函数语言编写触发器函数。

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.