Chapter 39. Extending SQL

Table of Contents

39.1. How Extensibility Works
39.2. The Postgres Pro Type System
39.2.1. Base Types
39.2.2. Container Types
39.2.3. Domains
39.2.4. Pseudo-Types
39.2.5. Polymorphic Types
39.3. User-Defined Functions
39.4. User-Defined Procedures
39.5. Query Language (SQL) Functions
39.5.1. Arguments for SQL Functions
39.5.2. SQL Functions on Base Types
39.5.3. SQL Functions on Composite Types
39.5.4. SQL Functions with Output Parameters
39.5.5. SQL Procedures with Output Parameters
39.5.6. SQL Functions with Variable Numbers of Arguments
39.5.7. SQL Functions with Default Values for Arguments
39.5.8. SQL Functions as Table Sources
39.5.9. SQL Functions Returning Sets
39.5.10. SQL Functions Returning TABLE
39.5.11. Polymorphic SQL Functions
39.5.12. SQL Functions with Collations
39.6. Function Overloading
39.7. Function Volatility Categories
39.8. Procedural Language Functions
39.9. Internal Functions
39.10. C-Language Functions
39.10.1. Dynamic Loading
39.10.2. Base Types in C-Language Functions
39.10.3. Version 1 Calling Conventions
39.10.4. Writing Code
39.10.5. Compiling and Linking Dynamically-Loaded Functions
39.10.6. Composite-Type Arguments
39.10.7. Returning Rows (Composite Types)
39.10.8. Returning Sets
39.10.9. Polymorphic Arguments and Return Types
39.10.10. Shared Memory and LWLocks
39.10.11. Using C++ for Extensibility
39.11. Function Optimization Information
39.12. User-Defined Aggregates
39.12.1. Moving-Aggregate Mode
39.12.2. Polymorphic and Variadic Aggregates
39.12.3. Ordered-Set Aggregates
39.12.4. Partial Aggregation
39.12.5. Support Functions for Aggregates
39.13. User-Defined Types
39.14. User-Defined Operators
39.15. Operator Optimization Information
39.15.1. COMMUTATOR
39.15.2. NEGATOR
39.15.3. RESTRICT
39.15.4. JOIN
39.15.5. HASHES
39.15.6. MERGES
39.16. Interfacing Extensions to Indexes
39.16.1. Index Methods and Operator Classes
39.16.2. Index Method Strategies
39.16.3. Index Method Support Routines
39.16.4. An Example
39.16.5. Operator Classes and Operator Families
39.16.6. System Dependencies on Operator Classes
39.16.7. Ordering Operators
39.16.8. Special Features of Operator Classes
39.17. Packaging Related Objects into an Extension
39.17.1. Extension Files
39.17.2. Extension Relocatability
39.17.3. Extension Configuration Tables
39.17.4. Extension Updates
39.17.5. Installing Extensions Using Update Scripts
39.17.6. Security Considerations for Extensions
39.17.7. Extension Example
39.18. Extension Building Infrastructure

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