V. Server Programming

This part is about extending the server functionality with user-defined functions, data types, triggers, etc. These are advanced topics which should probably be approached only after all the other user documentation about PostgreSQL has been understood. This part also describes the server-side programming languages available in the PostgreSQL distribution as well as general issues concerning server-side programming languages. This information is only useful to readers that have read at least the first few chapters of this part.

Table of Contents
31. Extending SQL
31.1. How Extensibility Works
31.2. The PostgreSQL Type System
31.3. User-Defined Functions
31.4. Query Language (SQL) Functions
31.5. Procedural Language Functions
31.6. Internal Functions
31.7. C-Language Functions
31.8. Function Overloading
31.9. User-Defined Aggregates
31.10. User-Defined Types
31.11. User-Defined Operators
31.12. Operator Optimization Information
31.13. Interfacing Extensions To Indexes
32. The Rule System
32.1. The Query Tree
32.2. Views and the Rule System
32.3. Rules on INSERT, UPDATE, and DELETE
32.4. Rules and Privileges
32.5. Rules and Command Status
32.6. Rules versus Triggers
33. Triggers
33.1. Overview of Trigger Behavior
33.2. Visibility of Data Changes
33.3. Writing Trigger Functions in C
33.4. A Complete Example
34. Procedural Languages
34.1. Installing Procedural Languages
35. PL/pgSQL - SQL Procedural Language
35.1. Overview
35.2. Tips for Developing in PL/pgSQL
35.3. Structure of PL/pgSQL
35.4. Declarations
35.5. Expressions
35.6. Basic Statements
35.7. Control Structures
35.8. Cursors
35.9. Errors and Messages
35.10. Trigger Procedures
35.11. Porting from Oracle PL/SQL
36. PL/Tcl - Tcl Procedural Language
36.1. Overview
36.2. PL/Tcl Functions and Arguments
36.3. Data Values in PL/Tcl
36.4. Global Data in PL/Tcl
36.5. Database Access from PL/Tcl
36.6. Trigger Procedures in PL/Tcl
36.7. Modules and the unknown command
36.8. Tcl Procedure Names
37. PL/Perl - Perl Procedural Language
37.1. PL/Perl Functions and Arguments
37.2. Database Access from PL/Perl
37.3. Data Values in PL/Perl
37.4. Global Values in PL/Perl
37.5. Trusted and Untrusted PL/Perl
37.6. PL/Perl Triggers
37.7. Limitations and Missing Features
38. PL/Python - Python Procedural Language
38.1. PL/Python Functions
38.2. Trigger Functions
38.3. Database Access
39. Server Programming Interface
39.1. Interface Functions
39.2. Interface Support Functions
39.3. Memory Management
39.4. Visibility of Data Changes
39.5. Examples