1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Replace ASCII-quotes with proper markup.

This commit is contained in:
Peter Eisentraut
2001-09-13 15:55:24 +00:00
parent 9f990a73c1
commit 351a0c1736
58 changed files with 303 additions and 301 deletions

View File

@ -1,4 +1,4 @@
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/plpython.sgml,v 1.3 2001/09/12 03:58:15 momjian Exp $ -->
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/plpython.sgml,v 1.4 2001/09/13 15:55:23 petere Exp $ -->
<chapter id="plpython">
<title>PL/Python - Python Procedural Language</title>
@ -69,23 +69,23 @@ def __plpython_procedure_myfunc_23456():
dictionary, as mentioned above.
</para>
</para>
<para>
When a function is used in a trigger, the dictionary TD contains
transaction related values. The trigger tuples are in TD["new"]
and/or TD["old"] depending on the trigger event. TD["event"]
contains the event as a string ("INSERT", "UPDATE", "DELETE", or
"UNKNOWN"). TD["when"] contains one of ("BEFORE", "AFTER", or
"UNKNOWN"). TD["level"] contains one of ("ROW", "STATEMENT", or
"UNKNOWN"). TD["name"] contains the trigger name, and TD["relid"]
transaction related values. The trigger tuples are in <literal>TD["new"]</>
and/or <literal>TD["old"]</> depending on the trigger event. <literal>TD["event"]</>
contains the event as a string (<literal>INSERT</>, <literal>UPDATE</>, <literal>DELETE</>, or
<literal>UNKNOWN</>). TD["when"] contains one of (<literal>BEFORE</>, <literal>AFTER</>, or
<literal>UNKNOWN</>). <literal>TD["level"]</> contains one of <literal>ROW</>, <literal>STATEMENT</>, or
<literal>UNKNOWN</>. <literal>TD["name"]</> contains the trigger name, and <literal>TD["relid"]</>
contains the relation id of the table on which the trigger occurred.
If the trigger was called with arguments they are available
in TD["args"][0] to TD["args"][(n -1)]
in <literal>TD["args"][0]</> to <literal>TD["args"][(n -1)]</>.
</para>
<para>
If the trigger 'when' is "BEFORE", you may Return 'None' or "OK"
from the python function to indicate the tuple is unmodified,
"SKIP" to abort the event, or "MODIFIED" to indicate you've
If the trigger <quote>when</quote> is <literal>BEFORE</>, you may return <literal>None</literal> or <literal>"OK"</literal>
from the Python function to indicate the tuple is unmodified,
<literal>"SKIP"</> to abort the event, or <literal>"MODIFIED"</> to indicate you've
modified the tuple.
</para>