]> begriffs open source - ai-pg/blob - full-docs/src/sgml/html/server-programming.html
PG 18 docs from https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0-docs...
[ai-pg] / full-docs / src / sgml / html / server-programming.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part V. Server Programming</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="infoschema-views.html" title="35.66. views" /><link rel="next" href="extend.html" title="Chapter 36. Extending SQL" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">Part V. Server Programming</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="infoschema-views.html" title="35.66. views">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="index.html" title="PostgreSQL 18.0 Documentation">Up</a></td><th width="60%" align="center">PostgreSQL 18.0 Documentation</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="extend.html" title="Chapter 36. Extending SQL">Next</a></td></tr></table><hr /></div><div class="part" id="SERVER-PROGRAMMING"><div class="titlepage"><div><div><h1 class="title">Part V. Server Programming</h1></div></div></div><div class="partintro" id="id-1.8.2"><div></div><p>
3     This part is about extending the server functionality with
4     user-defined functions, data types, triggers, etc.  These are
5     advanced topics which should be approached only after all
6     the other user documentation about <span class="productname">PostgreSQL</span> has
7     been understood.  Later chapters in this part describe the server-side
8     programming languages available in the
9     <span class="productname">PostgreSQL</span> distribution as well as
10     general issues concerning server-side programming.  It
11     is essential to read at least the earlier sections of <a class="xref" href="extend.html" title="Chapter 36. Extending SQL">Chapter 36</a> (covering functions) before diving into the
12     material about server-side programming.
13    </p><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="chapter"><a href="extend.html">36. Extending <acronym class="acronym">SQL</acronym></a></span></dt><dd><dl><dt><span class="sect1"><a href="extend-how.html">36.1. How Extensibility Works</a></span></dt><dt><span class="sect1"><a href="extend-type-system.html">36.2. The <span class="productname">PostgreSQL</span> Type System</a></span></dt><dt><span class="sect1"><a href="xfunc.html">36.3. User-Defined Functions</a></span></dt><dt><span class="sect1"><a href="xproc.html">36.4. User-Defined Procedures</a></span></dt><dt><span class="sect1"><a href="xfunc-sql.html">36.5. Query Language (<acronym class="acronym">SQL</acronym>) Functions</a></span></dt><dt><span class="sect1"><a href="xfunc-overload.html">36.6. Function Overloading</a></span></dt><dt><span class="sect1"><a href="xfunc-volatility.html">36.7. Function Volatility Categories</a></span></dt><dt><span class="sect1"><a href="xfunc-pl.html">36.8. Procedural Language Functions</a></span></dt><dt><span class="sect1"><a href="xfunc-internal.html">36.9. Internal Functions</a></span></dt><dt><span class="sect1"><a href="xfunc-c.html">36.10. C-Language Functions</a></span></dt><dt><span class="sect1"><a href="xfunc-optimization.html">36.11. Function Optimization Information</a></span></dt><dt><span class="sect1"><a href="xaggr.html">36.12. User-Defined Aggregates</a></span></dt><dt><span class="sect1"><a href="xtypes.html">36.13. User-Defined Types</a></span></dt><dt><span class="sect1"><a href="xoper.html">36.14. User-Defined Operators</a></span></dt><dt><span class="sect1"><a href="xoper-optimization.html">36.15. Operator Optimization Information</a></span></dt><dt><span class="sect1"><a href="xindex.html">36.16. Interfacing Extensions to Indexes</a></span></dt><dt><span class="sect1"><a href="extend-extensions.html">36.17. Packaging Related Objects into an Extension</a></span></dt><dt><span class="sect1"><a href="extend-pgxs.html">36.18. Extension Building Infrastructure</a></span></dt></dl></dd><dt><span class="chapter"><a href="triggers.html">37. Triggers</a></span></dt><dd><dl><dt><span class="sect1"><a href="trigger-definition.html">37.1. Overview of Trigger Behavior</a></span></dt><dt><span class="sect1"><a href="trigger-datachanges.html">37.2. Visibility of Data Changes</a></span></dt><dt><span class="sect1"><a href="trigger-interface.html">37.3. Writing Trigger Functions in C</a></span></dt><dt><span class="sect1"><a href="trigger-example.html">37.4. A Complete Trigger Example</a></span></dt></dl></dd><dt><span class="chapter"><a href="event-triggers.html">38. Event Triggers</a></span></dt><dd><dl><dt><span class="sect1"><a href="event-trigger-definition.html">38.1. Overview of Event Trigger Behavior</a></span></dt><dt><span class="sect1"><a href="event-trigger-interface.html">38.2. Writing Event Trigger Functions in C</a></span></dt><dt><span class="sect1"><a href="event-trigger-example.html">38.3. A Complete Event Trigger Example</a></span></dt><dt><span class="sect1"><a href="event-trigger-table-rewrite-example.html">38.4. A Table Rewrite Event Trigger Example</a></span></dt><dt><span class="sect1"><a href="event-trigger-database-login-example.html">38.5. A Database Login Event Trigger Example</a></span></dt></dl></dd><dt><span class="chapter"><a href="rules.html">39. The Rule System</a></span></dt><dd><dl><dt><span class="sect1"><a href="querytree.html">39.1. The Query Tree</a></span></dt><dt><span class="sect1"><a href="rules-views.html">39.2. Views and the Rule System</a></span></dt><dt><span class="sect1"><a href="rules-materializedviews.html">39.3. Materialized Views</a></span></dt><dt><span class="sect1"><a href="rules-update.html">39.4. Rules on <code class="command">INSERT</code>, <code class="command">UPDATE</code>, and <code class="command">DELETE</code></a></span></dt><dt><span class="sect1"><a href="rules-privileges.html">39.5. Rules and Privileges</a></span></dt><dt><span class="sect1"><a href="rules-status.html">39.6. Rules and Command Status</a></span></dt><dt><span class="sect1"><a href="rules-triggers.html">39.7. Rules Versus Triggers</a></span></dt></dl></dd><dt><span class="chapter"><a href="xplang.html">40. Procedural Languages</a></span></dt><dd><dl><dt><span class="sect1"><a href="xplang-install.html">40.1. Installing Procedural Languages</a></span></dt></dl></dd><dt><span class="chapter"><a href="plpgsql.html">41. <span class="application">PL/pgSQL</span> — <acronym class="acronym">SQL</acronym> Procedural Language</a></span></dt><dd><dl><dt><span class="sect1"><a href="plpgsql-overview.html">41.1. Overview</a></span></dt><dt><span class="sect1"><a href="plpgsql-structure.html">41.2. Structure of <span class="application">PL/pgSQL</span></a></span></dt><dt><span class="sect1"><a href="plpgsql-declarations.html">41.3. Declarations</a></span></dt><dt><span class="sect1"><a href="plpgsql-expressions.html">41.4. Expressions</a></span></dt><dt><span class="sect1"><a href="plpgsql-statements.html">41.5. Basic Statements</a></span></dt><dt><span class="sect1"><a href="plpgsql-control-structures.html">41.6. Control Structures</a></span></dt><dt><span class="sect1"><a href="plpgsql-cursors.html">41.7. Cursors</a></span></dt><dt><span class="sect1"><a href="plpgsql-transactions.html">41.8. Transaction Management</a></span></dt><dt><span class="sect1"><a href="plpgsql-errors-and-messages.html">41.9. Errors and Messages</a></span></dt><dt><span class="sect1"><a href="plpgsql-trigger.html">41.10. Trigger Functions</a></span></dt><dt><span class="sect1"><a href="plpgsql-implementation.html">41.11. <span class="application">PL/pgSQL</span> under the Hood</a></span></dt><dt><span class="sect1"><a href="plpgsql-development-tips.html">41.12. Tips for Developing in <span class="application">PL/pgSQL</span></a></span></dt><dt><span class="sect1"><a href="plpgsql-porting.html">41.13. Porting from <span class="productname">Oracle</span> PL/SQL</a></span></dt></dl></dd><dt><span class="chapter"><a href="pltcl.html">42. PL/Tcl — Tcl Procedural Language</a></span></dt><dd><dl><dt><span class="sect1"><a href="pltcl-overview.html">42.1. Overview</a></span></dt><dt><span class="sect1"><a href="pltcl-functions.html">42.2. PL/Tcl Functions and Arguments</a></span></dt><dt><span class="sect1"><a href="pltcl-data.html">42.3. Data Values in PL/Tcl</a></span></dt><dt><span class="sect1"><a href="pltcl-global.html">42.4. Global Data in PL/Tcl</a></span></dt><dt><span class="sect1"><a href="pltcl-dbaccess.html">42.5. Database Access from PL/Tcl</a></span></dt><dt><span class="sect1"><a href="pltcl-trigger.html">42.6. Trigger Functions in PL/Tcl</a></span></dt><dt><span class="sect1"><a href="pltcl-event-trigger.html">42.7. Event Trigger Functions in PL/Tcl</a></span></dt><dt><span class="sect1"><a href="pltcl-error-handling.html">42.8. Error Handling in PL/Tcl</a></span></dt><dt><span class="sect1"><a href="pltcl-subtransactions.html">42.9. Explicit Subtransactions in PL/Tcl</a></span></dt><dt><span class="sect1"><a href="pltcl-transactions.html">42.10. Transaction Management</a></span></dt><dt><span class="sect1"><a href="pltcl-config.html">42.11. PL/Tcl Configuration</a></span></dt><dt><span class="sect1"><a href="pltcl-procnames.html">42.12. Tcl Procedure Names</a></span></dt></dl></dd><dt><span class="chapter"><a href="plperl.html">43. PL/Perl — Perl Procedural Language</a></span></dt><dd><dl><dt><span class="sect1"><a href="plperl-funcs.html">43.1. PL/Perl Functions and Arguments</a></span></dt><dt><span class="sect1"><a href="plperl-data.html">43.2. Data Values in PL/Perl</a></span></dt><dt><span class="sect1"><a href="plperl-builtins.html">43.3. Built-in Functions</a></span></dt><dt><span class="sect1"><a href="plperl-global.html">43.4. Global Values in PL/Perl</a></span></dt><dt><span class="sect1"><a href="plperl-trusted.html">43.5. Trusted and Untrusted PL/Perl</a></span></dt><dt><span class="sect1"><a href="plperl-triggers.html">43.6. PL/Perl Triggers</a></span></dt><dt><span class="sect1"><a href="plperl-event-triggers.html">43.7. PL/Perl Event Triggers</a></span></dt><dt><span class="sect1"><a href="plperl-under-the-hood.html">43.8. PL/Perl Under the Hood</a></span></dt></dl></dd><dt><span class="chapter"><a href="plpython.html">44. PL/Python — Python Procedural Language</a></span></dt><dd><dl><dt><span class="sect1"><a href="plpython-funcs.html">44.1. PL/Python Functions</a></span></dt><dt><span class="sect1"><a href="plpython-data.html">44.2. Data Values</a></span></dt><dt><span class="sect1"><a href="plpython-sharing.html">44.3. Sharing Data</a></span></dt><dt><span class="sect1"><a href="plpython-do.html">44.4. Anonymous Code Blocks</a></span></dt><dt><span class="sect1"><a href="plpython-trigger.html">44.5. Trigger Functions</a></span></dt><dt><span class="sect1"><a href="plpython-database.html">44.6. Database Access</a></span></dt><dt><span class="sect1"><a href="plpython-subtransaction.html">44.7. Explicit Subtransactions</a></span></dt><dt><span class="sect1"><a href="plpython-transactions.html">44.8. Transaction Management</a></span></dt><dt><span class="sect1"><a href="plpython-util.html">44.9. Utility Functions</a></span></dt><dt><span class="sect1"><a href="plpython-python23.html">44.10. Python 2 vs. Python 3</a></span></dt><dt><span class="sect1"><a href="plpython-envar.html">44.11. Environment Variables</a></span></dt></dl></dd><dt><span class="chapter"><a href="spi.html">45. Server Programming Interface</a></span></dt><dd><dl><dt><span class="sect1"><a href="spi-interface.html">45.1. Interface Functions</a></span></dt><dt><span class="sect1"><a href="spi-interface-support.html">45.2. Interface Support Functions</a></span></dt><dt><span class="sect1"><a href="spi-memory.html">45.3. Memory Management</a></span></dt><dt><span class="sect1"><a href="spi-transaction.html">45.4. Transaction Management</a></span></dt><dt><span class="sect1"><a href="spi-visibility.html">45.5. Visibility of Data Changes</a></span></dt><dt><span class="sect1"><a href="spi-examples.html">45.6. Examples</a></span></dt></dl></dd><dt><span class="chapter"><a href="bgworker.html">46. Background Worker Processes</a></span></dt><dt><span class="chapter"><a href="logicaldecoding.html">47. Logical Decoding</a></span></dt><dd><dl><dt><span class="sect1"><a href="logicaldecoding-example.html">47.1. Logical Decoding Examples</a></span></dt><dt><span class="sect1"><a href="logicaldecoding-explanation.html">47.2. Logical Decoding Concepts</a></span></dt><dt><span class="sect1"><a href="logicaldecoding-walsender.html">47.3. Streaming Replication Protocol Interface</a></span></dt><dt><span class="sect1"><a href="logicaldecoding-sql.html">47.4. Logical Decoding <acronym class="acronym">SQL</acronym> Interface</a></span></dt><dt><span class="sect1"><a href="logicaldecoding-catalogs.html">47.5. System Catalogs Related to Logical Decoding</a></span></dt><dt><span class="sect1"><a href="logicaldecoding-output-plugin.html">47.6. Logical Decoding Output Plugins</a></span></dt><dt><span class="sect1"><a href="logicaldecoding-writer.html">47.7. Logical Decoding Output Writers</a></span></dt><dt><span class="sect1"><a href="logicaldecoding-synchronous.html">47.8. Synchronous Replication Support for Logical Decoding</a></span></dt><dt><span class="sect1"><a href="logicaldecoding-streaming.html">47.9. Streaming of Large Transactions for Logical Decoding</a></span></dt><dt><span class="sect1"><a href="logicaldecoding-two-phase-commits.html">47.10. Two-phase Commit Support for Logical Decoding</a></span></dt></dl></dd><dt><span class="chapter"><a href="replication-origins.html">48. Replication Progress Tracking</a></span></dt><dt><span class="chapter"><a href="archive-modules.html">49. Archive Modules</a></span></dt><dd><dl><dt><span class="sect1"><a href="archive-module-init.html">49.1. Initialization Functions</a></span></dt><dt><span class="sect1"><a href="archive-module-callbacks.html">49.2. Archive Module Callbacks</a></span></dt></dl></dd><dt><span class="chapter"><a href="oauth-validators.html">50. OAuth Validator Modules</a></span></dt><dd><dl><dt><span class="sect1"><a href="oauth-validator-design.html">50.1. Safely Designing a Validator Module</a></span></dt><dt><span class="sect1"><a href="oauth-validator-init.html">50.2. Initialization Functions</a></span></dt><dt><span class="sect1"><a href="oauth-validator-callbacks.html">50.3. OAuth Validator Callbacks</a></span></dt></dl></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="infoschema-views.html" title="35.66. views">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html" title="PostgreSQL 18.0 Documentation">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="extend.html" title="Chapter 36. Extending SQL">Next</a></td></tr><tr><td width="40%" align="left" valign="top">35.66. <code class="literal">views</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> Chapter 36. Extending <acronym class="acronym">SQL</acronym></td></tr></table></div></body></html>