Chapter 36. Extending SQL

Table of Contents

36.1. How Extensibility Works
36.2. The Postgres Pro Type System
36.2.1. Base Types
36.2.2. Container Types
36.2.3. Domains
36.2.4. Pseudo-Types
36.2.5. Polymorphic Types
36.3. User-defined Functions
36.4. User-defined Procedures
36.5. Query Language (SQL) Functions
36.5.1. Arguments for SQL Functions
36.5.2. SQL Functions on Base Types
36.5.3. SQL Functions on Composite Types
36.5.4. SQL Functions with Output Parameters
36.5.5. SQL Functions with Variable Numbers of Arguments
36.5.6. SQL Functions with Default Values for Arguments
36.5.7. SQL Functions as Table Sources
36.5.8. SQL Functions Returning Sets
36.5.9. SQL Functions Returning TABLE
36.5.10. Polymorphic SQL Functions
36.5.11. SQL Functions with Collations
36.6. Function Overloading
36.7. Function Volatility Categories
36.8. Procedural Language Functions
36.9. Internal Functions
36.10. C-Language Functions
36.10.1. Dynamic Loading
36.10.2. Base Types in C-Language Functions
36.10.3. Version 1 Calling Conventions
36.10.4. Writing Code
36.10.5. Compiling and Linking Dynamically-loaded Functions
36.10.6. Composite-type Arguments
36.10.7. Returning Rows (Composite Types)
36.10.8. Returning Sets
36.10.9. Polymorphic Arguments and Return Types
36.10.10. Transform Functions
36.10.11. Shared Memory and LWLocks
36.10.12. Using C++ for Extensibility
36.11. User-defined Aggregates
36.11.1. Moving-Aggregate Mode
36.11.2. Polymorphic and Variadic Aggregates
36.11.3. Ordered-Set Aggregates
36.11.4. Partial Aggregation
36.11.5. Support Functions for Aggregates
36.12. User-defined Types
36.13. User-defined Operators
36.14. Operator Optimization Information
36.14.1. COMMUTATOR
36.14.2. NEGATOR
36.14.3. RESTRICT
36.14.4. JOIN
36.14.5. HASHES
36.14.6. MERGES
36.15. Interfacing Extensions To Indexes
36.15.1. Index Methods and Operator Classes
36.15.2. Index Method Strategies
36.15.3. Index Method Support Routines
36.15.4. An Example
36.15.5. Operator Classes and Operator Families
36.15.6. System Dependencies on Operator Classes
36.15.7. Ordering Operators
36.15.8. Special Features of Operator Classes
36.16. Packaging Related Objects into an Extension
36.16.1. Extension Files
36.16.2. Extension Relocatability
36.16.3. Extension Configuration Tables
36.16.4. Extension Updates
36.16.5. Installing Extensions using Update Scripts
36.16.6. Security Considerations for Extensions
36.16.7. Extension Example
36.17. Extension Building Infrastructure

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