Chapter 40. Extending SQL

Table of Contents

40.1. How Extensibility Works
40.2. The PostgreSQL Type System
40.2.1. Base Types
40.2.2. Container Types
40.2.3. Domains
40.2.4. Pseudo-Types
40.2.5. Polymorphic Types
40.3. User-Defined Functions
40.4. User-Defined Procedures
40.5. Query Language (SQL) Functions
40.5.1. Arguments for SQL Functions
40.5.2. SQL Functions on Base Types
40.5.3. SQL Functions on Composite Types
40.5.4. SQL Functions with Output Parameters
40.5.5. SQL Procedures with Output Parameters
40.5.6. SQL Functions with Variable Numbers of Arguments
40.5.7. SQL Functions with Default Values for Arguments
40.5.8. SQL Functions as Table Sources
40.5.9. SQL Functions Returning Sets
40.5.10. SQL Functions Returning TABLE
40.5.11. Polymorphic SQL Functions
40.5.12. SQL Functions with Collations
40.6. Function Overloading
40.7. Function Volatility Categories
40.8. Procedural Language Functions
40.9. Internal Functions
40.10. C-Language Functions
40.10.1. Dynamic Loading
40.10.2. Base Types in C-Language Functions
40.10.3. Version 1 Calling Conventions
40.10.4. Writing Code
40.10.5. Compiling and Linking Dynamically-Loaded Functions
40.10.6. Composite-Type Arguments
40.10.7. Returning Rows (Composite Types)
40.10.8. Returning Sets
40.10.9. Polymorphic Arguments and Return Types
40.10.10. Shared Memory and LWLocks
40.10.11. Using C++ for Extensibility
40.11. Function Optimization Information
40.12. User-Defined Aggregates
40.12.1. Moving-Aggregate Mode
40.12.2. Polymorphic and Variadic Aggregates
40.12.3. Ordered-Set Aggregates
40.12.4. Partial Aggregation
40.12.5. Support Functions for Aggregates
40.13. User-Defined Types
40.13.1. TOAST Considerations
40.14. User-Defined Operators
40.15. Operator Optimization Information
40.15.1. COMMUTATOR
40.15.2. NEGATOR
40.15.3. RESTRICT
40.15.4. JOIN
40.15.5. HASHES
40.15.6. MERGES
40.16. Interfacing Extensions to Indexes
40.16.1. Index Methods and Operator Classes
40.16.2. Index Method Strategies
40.16.3. Index Method Support Routines
40.16.4. An Example
40.16.5. Operator Classes and Operator Families
40.16.6. System Dependencies on Operator Classes
40.16.7. Ordering Operators
40.16.8. Special Features of Operator Classes
40.17. Packaging Related Objects into an Extension
40.17.1. Extension Files
40.17.2. Extension Relocatability
40.17.3. Extension Configuration Tables
40.17.4. Extension Updates
40.17.5. Installing Extensions Using Update Scripts
40.17.6. Security Considerations for Extensions
40.17.7. Extension Example
40.18. Extension Building Infrastructure

In the sections that follow, we will discuss how you can extend the PostgreSQL SQL query language by adding: