Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 9b6cc37ce608401d44f6535a0c7cb777 > files > 764

postgresql11-docs-11.5-1.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!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>SPI_register_trigger_data</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="spi-spi-unregister-relation.html" title="SPI_unregister_relation" /><link rel="next" href="spi-interface-support.html" title="47.2. Interface Support Functions" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">SPI_register_trigger_data</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="spi-spi-unregister-relation.html" title="SPI_unregister_relation">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="spi-interface.html" title="47.1. Interface Functions">Up</a></td><th width="60%" align="center">47.1. Interface Functions</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 11.5 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="spi-interface-support.html" title="47.2. Interface Support Functions">Next</a></td></tr></table><hr></hr></div><div class="refentry" id="SPI-SPI-REGISTER-TRIGGER-DATA"><div class="titlepage"></div><a id="id-1.8.12.8.29.1" class="indexterm"></a><a id="id-1.8.12.8.29.2" class="indexterm"></a><a id="id-1.8.12.8.29.3" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle">SPI_register_trigger_data</span></h2><p>SPI_register_trigger_data — make ephemeral trigger data available in SPI queries</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
int SPI_register_trigger_data(TriggerData *<em class="parameter"><code>tdata</code></em>)
</pre></div><div class="refsect1" id="id-1.8.12.8.29.7"><h2>Description</h2><p>
   <code class="function">SPI_register_trigger_data</code> makes any ephemeral
   relations captured by a trigger available to queries planned and executed
   through the current SPI connection.  Currently, this means the transition
   tables captured by an <code class="literal">AFTER</code> trigger defined with a
   <code class="literal">REFERENCING OLD/NEW TABLE AS</code> ... clause.  This function
   should be called by a PL trigger handler function after connecting.
  </p></div><div class="refsect1" id="id-1.8.12.8.29.8"><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">TriggerData *<em class="parameter"><code>tdata</code></em></code></span></dt><dd><p>
       the <code class="structname">TriggerData</code> object passed to a trigger
       handler function as <code class="literal">fcinfo-&gt;context</code>
     </p></dd></dl></div></div><div class="refsect1" id="id-1.8.12.8.29.9"><h2>Return Value</h2><p>
   If the execution of the command was successful then the following
   (nonnegative) value will be returned:

   </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="symbol">SPI_OK_TD_REGISTER</code></span></dt><dd><p>
       if the captured trigger data (if any) has been successfully registered
      </p></dd></dl></div><p>
  </p><p>
   On error, one of the following negative values is returned:

   </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="symbol">SPI_ERROR_ARGUMENT</code></span></dt><dd><p>
       if <em class="parameter"><code>tdata</code></em> is <code class="symbol">NULL</code>
      </p></dd><dt><span class="term"><code class="symbol">SPI_ERROR_UNCONNECTED</code></span></dt><dd><p>
       if called from an unconnected C function
      </p></dd><dt><span class="term"><code class="symbol">SPI_ERROR_REL_DUPLICATE</code></span></dt><dd><p>
       if the name of any trigger data transient relation is already
       registered for this connection
      </p></dd></dl></div><p>
  </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="spi-spi-unregister-relation.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spi-interface.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="spi-interface-support.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SPI_unregister_relation </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 47.2. Interface Support Functions</td></tr></table></div></body></html>