From c326d8f4f20a9b98f6faa760ccf2cd13fb289dc8 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 31 Aug 2003 17:32:24 +0000 Subject: Add/edit index entries. --- doc/src/sgml/plpython.sgml | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'doc/src/sgml/plpython.sgml') diff --git a/doc/src/sgml/plpython.sgml b/doc/src/sgml/plpython.sgml index 0a101384ee..2f854a3a83 100644 --- a/doc/src/sgml/plpython.sgml +++ b/doc/src/sgml/plpython.sgml @@ -1,4 +1,4 @@ - + PL/Python - Python Procedural Language @@ -68,9 +68,10 @@ def __plpython_procedure_myfunc_23456(): If you do not provide a return value, Python returns the default - None. The - language module translates Python's None into the - SQL null value. + None. The language module translates Python's + None into the SQL null + value.null valuein PL/Python @@ -87,7 +88,9 @@ def __plpython_procedure_myfunc_23456(): The global dictionary SD is available to store data between function calls. This variable is private static data. The global dictionary GD is public data, - available to all Python functions within a session. Use with care. + available to all Python functions within a session. Use with + care.global datain + PL/Python @@ -102,6 +105,11 @@ def __plpython_procedure_myfunc_23456(): Trigger Functions + + trigger + in PL/Python + + When a function is used in a trigger, the dictionary TD contains trigger-related values. The trigger @@ -146,7 +154,8 @@ def __plpython_procedure_myfunc_23456(): plpy.error("msg"), and plpy.fatal("msg"). They are mostly equivalent to calling elog(LEVEL, "msg") - from C code. plpy.error and + from C code.elogin + PL/Python plpy.error and plpy.fatal actually raise a Python exception which, if uncaught, causes the PL/Python module to call elog(ERROR, msg) when the function handler @@ -187,10 +196,11 @@ foo = rv[i]["my_column"] - The second function, plpy.prepare, prepares the - execution plan for a query. It is called with a query string and a - list of parameter types, if you have parameter references in the - query. For example: + preparing a queryin PL/Python + The second function, plpy.prepare, prepares + the execution plan for a query. It is called with a query string + and a list of parameter types, if you have parameter references in + the query. For example: plan = plpy.prepare("SELECT last_name FROM my_users WHERE first_name = $1", [ "text" ]) @@ -235,7 +245,8 @@ CREATE FUNCTION usesavedplan() RETURNS trigger AS ' - Restricted Environment @@ -259,6 +270,6 @@ CREATE FUNCTION usesavedplan() RETURNS trigger AS ' ---> +]]> -- cgit v1.2.1