Supported Versions: Current (16) / 15 / 14 / 13 / 12
Development Versions: devel
Unsupported versions: 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4

Part 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. Later chapters in this part describe the server-side programming languages available in the PostgreSQL distribution as well as general issues concerning server-side programming languages. It is essential to read at least the earlier sections of Chapter 37 (covering functions) before diving into the material about server-side programming languages.

Table of Contents

37. Extending SQL
37.1. How Extensibility Works
37.2. The PostgreSQL Type System
37.3. User-Defined Functions
37.4. User-Defined Procedures
37.5. Query Language (SQL) Functions
37.6. Function Overloading
37.7. Function Volatility Categories
37.8. Procedural Language Functions
37.9. Internal Functions
37.10. C-Language Functions
37.11. Function Optimization Information
37.12. User-Defined Aggregates
37.13. User-Defined Types
37.14. User-Defined Operators
37.15. Operator Optimization Information
37.16. Interfacing Extensions to Indexes
37.17. Packaging Related Objects into an Extension
37.18. Extension Building Infrastructure
38. Triggers
38.1. Overview of Trigger Behavior
38.2. Visibility of Data Changes
38.3. Writing Trigger Functions in C
38.4. A Complete Trigger Example
39. Event Triggers
39.1. Overview of Event Trigger Behavior
39.2. Event Trigger Firing Matrix
39.3. Writing Event Trigger Functions in C
39.4. A Complete Event Trigger Example
39.5. A Table Rewrite Event Trigger Example
40. The Rule System
40.1. The Query Tree
40.2. Views and the Rule System
40.3. Materialized Views
40.4. Rules on INSERT, UPDATE, and DELETE
40.5. Rules and Privileges
40.6. Rules and Command Status
40.7. Rules Versus Triggers
41. Procedural Languages
41.1. Installing Procedural Languages
42. PL/pgSQLSQL Procedural Language
42.1. Overview
42.2. Structure of PL/pgSQL
42.3. Declarations
42.4. Expressions
42.5. Basic Statements
42.6. Control Structures
42.7. Cursors
42.8. Transaction Management
42.9. Errors and Messages
42.10. Trigger Functions
42.11. PL/pgSQL under the Hood
42.12. Tips for Developing in PL/pgSQL
42.13. Porting from Oracle PL/SQL
43. PL/Tcl — Tcl Procedural Language
43.1. Overview
43.2. PL/Tcl Functions and Arguments
43.3. Data Values in PL/Tcl
43.4. Global Data in PL/Tcl
43.5. Database Access from PL/Tcl
43.6. Trigger Functions in PL/Tcl
43.7. Event Trigger Functions in PL/Tcl
43.8. Error Handling in PL/Tcl
43.9. Explicit Subtransactions in PL/Tcl
43.10. Transaction Management
43.11. PL/Tcl Configuration
43.12. Tcl Procedure Names
44. PL/Perl — Perl Procedural Language
44.1. PL/Perl Functions and Arguments
44.2. Data Values in PL/Perl
44.3. Built-in Functions
44.4. Global Values in PL/Perl
44.5. Trusted and Untrusted PL/Perl
44.6. PL/Perl Triggers
44.7. PL/Perl Event Triggers
44.8. PL/Perl Under the Hood
45. PL/Python — Python Procedural Language
45.1. Python 2 vs. Python 3
45.2. PL/Python Functions
45.3. Data Values
45.4. Sharing Data
45.5. Anonymous Code Blocks
45.6. Trigger Functions
45.7. Database Access
45.8. Explicit Subtransactions
45.9. Transaction Management
45.10. Utility Functions
45.11. Environment Variables
46. Server Programming Interface
46.1. Interface Functions
46.2. Interface Support Functions
46.3. Memory Management
46.4. Transaction Management
46.5. Visibility of Data Changes
46.6. Examples
47. Background Worker Processes
48. Logical Decoding
48.1. Logical Decoding Examples
48.2. Logical Decoding Concepts
48.3. Streaming Replication Protocol Interface
48.4. Logical Decoding SQL Interface
48.5. System Catalogs Related to Logical Decoding
48.6. Logical Decoding Output Plugins
48.7. Logical Decoding Output Writers
48.8. Synchronous Replication Support for Logical Decoding
49. Replication Progress Tracking

Submit correction

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.