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
34. Extending SQL
34.1. How Extensibility Works
34.2. The PostgreSQL Type System
34.3. User-Defined Functions
34.4. Query Language (SQL) Functions
34.5. Procedural Language Functions
34.6. Internal Functions
34.7. C-Language Functions
34.8. Function Overloading
34.9. Procedural Language Handlers
34.10. User-Defined Aggregates
34.11. User-Defined Types
34.12. User-defined Operators
34.13. Operator Optimization Information
34.14. Interfacing Extensions To Indexes
35. Index Cost Estimation Functions
36. The Rule System
36.1. The Query Tree
36.2. Views and the Rule System
36.3. Rules on INSERT, UPDATE, and DELETE
36.4. Rules and Privileges
36.5. Rules and Command Status
36.6. Rules versus Triggers
37. Triggers
37.1. Trigger Definition
37.2. Interaction with the Trigger Manager
37.3. Visibility of Data Changes
37.4. A Complete Example
38. Server Programming Interface
38.1. Interface Functions
38.2. Interface Support Functions
38.3. Memory Management
38.4. Visibility of Data Changes
38.5. Examples
39. Procedural Languages
39.1. Installing Procedural Languages
40. PL/pgSQL - SQL Procedural Language
40.1. Overview
40.2. Tips for Developing in PL/pgSQL
40.3. Structure of PL/pgSQL
40.4. Declarations
40.5. Expressions
40.6. Basic Statements
40.7. Control Structures
40.8. Cursors
40.9. Errors and Messages
40.10. Trigger Procedures
40.11. Porting from Oracle PL/SQL
41. PL/Tcl - Tcl Procedural Language
41.1. Overview
41.2. PL/Tcl Functions and Arguments
41.3. Data Values in PL/Tcl
41.4. Global Data in PL/Tcl
41.5. Database Access from PL/Tcl
41.6. Trigger Procedures in PL/Tcl
41.7. Modules and the unknown command
41.8. Tcl Procedure Names
42. PL/Perl - Perl Procedural Language
42.1. PL/Perl Functions and Arguments
42.2. Data Values in PL/Perl
42.3. Database Access from PL/Perl
42.4. Trusted and Untrusted PL/Perl
42.5. Missing Features
43. PL/Python - Python Procedural Language
43.1. PL/Python Functions
43.2. Trigger Functions
43.3. Database Access