跳至主要內容

KlustronDB大约 2 分钟

Chapter 38. Extending SQL

Table of Contents

38.1. How Extensibility Works

38.2. The PostgreSQL Type System : 38.2.1. Base Types

[38.2.2. Container Types](extend-type-system.md#id-1.8.3.5.10)

[38.2.3. Domains](extend-type-system.md#EXTEND-TYPE-SYSTEM-DOMAINS)

[38.2.4. Pseudo-Types](extend-type-system.md#id-1.8.3.5.12)

[38.2.5. Polymorphic Types](extend-type-system.md#EXTEND-TYPES-POLYMORPHIC)

38.3. User-defined Functions

38.4. User-defined Procedures

38.5. Query Language (SQL) Functions : 38.5.1. Arguments for SQL Functions

[38.5.2. SQL Functions on Base Types](xfunc-sql.md#XFUNC-SQL-BASE-FUNCTIONS)

[38.5.3. SQL Functions on Composite Types](xfunc-sql.md#XFUNC-SQL-COMPOSITE-FUNCTIONS)

[38.5.4. SQL Functions with Output Parameters](xfunc-sql.md#XFUNC-OUTPUT-PARAMETERS)

[38.5.5. SQL Functions with Variable Numbers of Arguments](xfunc-sql.md#XFUNC-SQL-VARIADIC-FUNCTIONS)

[38.5.6. SQL Functions with Default Values for Arguments](xfunc-sql.md#XFUNC-SQL-PARAMETER-DEFAULTS)

[38.5.7. SQL Functions as Table Sources](xfunc-sql.md#XFUNC-SQL-TABLE-FUNCTIONS)

[38.5.8. SQL Functions Returning Sets](xfunc-sql.md#XFUNC-SQL-FUNCTIONS-RETURNING-SET)

[38.5.9. SQL Functions Returning `TABLE`](xfunc-sql.md#XFUNC-SQL-FUNCTIONS-RETURNING-TABLE)

[38.5.10. Polymorphic SQL Functions](xfunc-sql.md#id-1.8.3.8.18)

[38.5.11. SQL Functions with Collations](xfunc-sql.md#id-1.8.3.8.19)

38.6. Function Overloading

38.7. Function Volatility Categories

38.8. Procedural Language Functions

38.9. Internal Functions

38.10. C-Language Functions : 38.10.1. Dynamic Loading

[38.10.2. Base Types in C-Language Functions](xfunc-c.md#XFUNC-C-BASETYPE)

[38.10.3. Version 1 Calling Conventions](xfunc-c.md#id-1.8.3.13.7)

[38.10.4. Writing Code](xfunc-c.md#id-1.8.3.13.8)

[38.10.5. Compiling and Linking Dynamically-loaded Functions](xfunc-c.md#DFUNC)

[38.10.6. Composite-type Arguments](xfunc-c.md#id-1.8.3.13.10)

[38.10.7. Returning Rows (Composite Types)](xfunc-c.md#id-1.8.3.13.11)

[38.10.8. Returning Sets](xfunc-c.md#XFUNC-C-RETURN-SET)

[38.10.9. Polymorphic Arguments and Return Types](xfunc-c.md#id-1.8.3.13.13)

[38.10.10. Transform Functions](xfunc-c.md#XFUNC-TRANSFORM-FUNCTIONS)

[38.10.11. Shared Memory and LWLocks](xfunc-c.md#id-1.8.3.13.15)

[38.10.12. Using C++ for Extensibility](xfunc-c.md#EXTEND-CPP)

38.11. User-defined Aggregates : 38.11.1. Moving-Aggregate Mode

[38.11.2. Polymorphic and Variadic Aggregates](xaggr.md#XAGGR-POLYMORPHIC-AGGREGATES)

[38.11.3. Ordered-Set Aggregates](xaggr.md#XAGGR-ORDERED-SET-AGGREGATES)

[38.11.4. Partial Aggregation](xaggr.md#XAGGR-PARTIAL-AGGREGATES)

[38.11.5. Support Functions for Aggregates](xaggr.md#XAGGR-SUPPORT-FUNCTIONS)

38.12. User-defined Types : 38.12.1. TOAST Considerations

38.13. User-defined Operators

38.14. Operator Optimization Information : 38.14.1. COMMUTATOR

[38.14.2. `NEGATOR`](xoper-optimization.md#id-1.8.3.17.5)

[38.14.3. `RESTRICT`](xoper-optimization.md#id-1.8.3.17.6)

[38.14.4. `JOIN`](xoper-optimization.md#id-1.8.3.17.7)

[38.14.5. `HASHES`](xoper-optimization.md#id-1.8.3.17.8)

[38.14.6. `MERGES`](xoper-optimization.md#id-1.8.3.17.9)

38.15. Interfacing Extensions To Indexes : 38.15.1. Index Methods and Operator Classes

[38.15.2. Index Method Strategies](xindex.md#XINDEX-STRATEGIES)

[38.15.3. Index Method Support Routines](xindex.md#XINDEX-SUPPORT)

[38.15.4. An Example](xindex.md#XINDEX-EXAMPLE)

[38.15.5. Operator Classes and Operator Families](xindex.md#XINDEX-OPFAMILY)

[38.15.6. System Dependencies on Operator Classes](xindex.md#XINDEX-OPCLASS-DEPENDENCIES)

[38.15.7. Ordering Operators](xindex.md#XINDEX-ORDERING-OPS)

[38.15.8. Special Features of Operator Classes](xindex.md#XINDEX-OPCLASS-FEATURES)

38.16. Packaging Related Objects into an Extension : 38.16.1. Defining Extension Objects

[38.16.2. Extension Files](extend-extensions.md#id-1.8.3.19.12)

[38.16.3. Extension Relocatability](extend-extensions.md#EXTEND-EXTENSIONS-RELOCATION)

[38.16.4. Extension Configuration Tables](extend-extensions.md#EXTEND-EXTENSIONS-CONFIG-TABLES)

[38.16.5. Extension Updates](extend-extensions.md#id-1.8.3.19.15)

[38.16.6. Installing Extensions using Update Scripts](extend-extensions.md#id-1.8.3.19.16)

[38.16.7. Extension Example](extend-extensions.md#EXTEND-EXTENSIONS-EXAMPLE)

38.17. Extension Building Infrastructure

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