Chapter 41. Extending SQL

Table of Contents

41.1. How Extensibility Works
41.2. The Postgres Pro Type System
41.2.1. Base Types
41.2.2. Container Types
41.2.3. Domains
41.2.4. Pseudo-Types
41.2.5. Polymorphic Types
41.3. User-Defined Functions
41.4. User-Defined Procedures
41.5. Query Language (SQL) Functions
41.5.1. Arguments for SQL Functions
41.5.2. SQL Functions on Base Types
41.5.3. SQL Functions on Composite Types
41.5.4. SQL Functions with Output Parameters
41.5.5. SQL Procedures with Output Parameters
41.5.6. SQL Functions with Variable Numbers of Arguments
41.5.7. SQL Functions with Default Values for Arguments
41.5.8. SQL Functions as Table Sources
41.5.9. SQL Functions Returning Sets
41.5.10. SQL Functions Returning TABLE
41.5.11. Polymorphic SQL Functions
41.5.12. SQL Functions with Collations
41.6. Function Overloading
41.7. Function Volatility Categories
41.8. Procedural Language Functions
41.9. Internal Functions
41.10. C-Language Functions
41.10.1. Dynamic Loading
41.10.2. Base Types in C-Language Functions
41.10.3. Version 1 Calling Conventions
41.10.4. Writing Code
41.10.5. Compiling and Linking Dynamically-Loaded Functions
41.10.6. Composite-Type Arguments
41.10.7. Returning Rows (Composite Types)
41.10.8. Returning Sets
41.10.9. Polymorphic Arguments and Return Types
41.10.10. Shared Memory and LWLocks
41.10.11. Using C++ for Extensibility
41.11. Function Optimization Information
41.12. User-Defined Aggregates
41.12.1. Moving-Aggregate Mode
41.12.2. Polymorphic and Variadic Aggregates
41.12.3. Ordered-Set Aggregates
41.12.4. Partial Aggregation
41.12.5. Support Functions for Aggregates
41.13. User-Defined Types
41.14. User-Defined Operators
41.15. Operator Optimization Information
41.15.1. COMMUTATOR
41.15.2. NEGATOR
41.15.3. RESTRICT
41.15.4. JOIN
41.15.5. HASHES
41.15.6. MERGES
41.16. Interfacing Extensions to Indexes
41.16.1. Index Methods and Operator Classes
41.16.2. Index Method Strategies
41.16.3. Index Method Support Routines
41.16.4. An Example
41.16.5. Operator Classes and Operator Families
41.16.6. System Dependencies on Operator Classes
41.16.7. Ordering Operators
41.16.8. Special Features of Operator Classes
41.17. Packaging Related Objects into an Extension
41.17.1. Extension Files
41.17.2. Extension Relocatability
41.17.3. Extension Configuration Tables
41.17.4. Extension Updates
41.17.5. Installing Extensions Using Update Scripts
41.17.6. Security Considerations for Extensions
41.17.7. Extension Example
41.18. Extension Building Infrastructure

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