11<!--
2- $Header: /cvsroot/pgsql/doc/src/sgml/xplang.sgml,v 1.7 2000/03/31 03:27:42 thomas Exp $
2+ $Header: /cvsroot/pgsql/doc/src/sgml/xplang.sgml,v 1.8 2000/04/02 22:59:40 tgl Exp $
33-->
44
55 <chapter id="xplang">
@@ -10,14 +10,19 @@ $Header: /cvsroot/pgsql/doc/src/sgml/xplang.sgml,v 1.7 2000/03/31 03:27:42 thoma
1010 the definition of procedural languages.
1111 In the case of a function or trigger
1212 procedure defined in a procedural language, the database has
13- nobuiltin knowlege how to interpret thefunctions source
14- text. Instead, thecalls are passedinto
13+ nobuilt-in knowledge about how to interpret thefunction's source
14+ text. Instead, thetask is passedto
1515 a handler that knows the details of the language. The
1616 handler itself is a special programming language function
1717 compiled into a shared object
1818 and loaded on demand.
1919 </para>
2020
21+ <para>
22+ Writing a handler for a new procedural language (PL)
23+ is outside the scope of this manual.
24+ </para>
25+
2126 <sect1>
2227 <title>Installing Procedural Languages</title>
2328
@@ -28,6 +33,9 @@ $Header: /cvsroot/pgsql/doc/src/sgml/xplang.sgml,v 1.7 2000/03/31 03:27:42 thoma
2833
2934 <para>
3035 A procedural language is installed in the database in three steps.
36+ (For the languages supplied with the standard distribution, the
37+ shell script <filename>createlang</filename> can be used instead
38+ of carrying out the details manually.)
3139 </para>
3240
3341 <step performance="Required">
@@ -39,10 +47,6 @@ $Header: /cvsroot/pgsql/doc/src/sgml/xplang.sgml,v 1.7 2000/03/31 03:27:42 thoma
3947 configured in, the handler for PL/Tcl is also built
4048 and installed in the same location.
4149 </para>
42- <para>
43- Writing a handler for a new procedural language (PL)
44- is outside the scope of this manual.
45- </para>
4650 </step>
4751 <step performance="Required">
4852 <para>
@@ -53,8 +57,8 @@ CREATE FUNCTION <replaceable>handler_function_name</replaceable> ()
5357 '<filename>path-to-shared-object</filename>' LANGUAGE 'C';
5458 </programlisting>
5559 The special return type of <acronym>OPAQUE</acronym> tells
56- the database, that this function does not return one of
57- the definedbase- or composite types and is not directly usable
60+ the database that this function does not return one of
61+ the defined<acronym>SQL</acronym> datatypes and is not directly usable
5862 in <acronym>SQL</acronym> statements.
5963 </para>
6064 </step>
@@ -67,11 +71,12 @@ CREATE [ TRUSTED ] PROCEDURAL LANGUAGE '<replaceable>language-name</replaceable>
6771 LANCOMPILER '<replaceable>description</replaceable>';
6872 </programlisting>
6973 The optional keyword <acronym>TRUSTED</acronym> tells
70- if ordinary database users that have no superuser
71- privilegescan use this language to create functions
74+ whether ordinary database users that have no superuser
75+ privilegesshould be allowed to use this language to create functions
7276 and trigger procedures. Since PL functions are
73- executed inside the database backend it should only be used for
74- languages that don't gain access to database backends
77+ executed inside the database backend, the <acronym>TRUSTED</acronym>
78+ flag should only be given for
79+ languages that don't allow access to database backends
7580 internals or the filesystem. The languages PL/pgSQL and
7681 PL/Tcl are known to be trusted.
7782 </para>
@@ -83,7 +88,7 @@ CREATE [ TRUSTED ] PROCEDURAL LANGUAGE '<replaceable>language-name</replaceable>
8388 <step performance="Required">
8489 <para>
8590 The following command tells the database where to find the
86- shared object for the PL/pgSQLlanguages call handler function.
91+ shared object for the PL/pgSQLlanguage's call handler function.
8792
8893 <programlisting>
8994CREATE FUNCTION plpgsql_call_handler () RETURNS OPAQUE AS
@@ -116,7 +121,7 @@ CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
116121 functions call arguments and it's return data type. The source
117122 text of the functions body is found in the prosrc attribute of
118123 <literal>pg_proc</literal>.
119- Due to this,in contrast to C language functions, PL functions
124+ Due to this, PL functions
120125 can be overloaded like SQL language functions. There can be
121126 multiple different PL functions having the same function name,
122127 as long as the call arguments differ.