|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/pltcl.sgml,v 2.40 2006/05/27 20:24:16 adunstan Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/pltcl.sgml,v 2.41 2006/05/30 11:40:21 momjian Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="pltcl">
|
4 | 4 | <title>PL/Tcl - Tcl Procedural Language</title>
|
|
25 | 25 | <title>Overview</title>
|
26 | 26 |
|
27 | 27 | <para>
|
28 |
| - PL/Tcl offers most of the capabilities a function |
29 |
| - writer has in the C language, except for some restrictions. |
| 28 | + PL/Tcl offers most of the capabilities a function writer has in |
| 29 | + the C language, with a few restrictions, and with the addition of |
| 30 | + the powerful string processing libraries that are available for |
| 31 | + Tcl. |
30 | 32 | </para>
|
31 | 33 | <para>
|
32 |
| - The good restriction is that everything is executed in a safe |
33 |
| - Tcl interpreter. In addition to the limited command set of safe Tcl, only |
34 |
| - a few commands are available to access the database via SPI and to raise |
35 |
| - messages via <function>elog()</>. There is no way to access internals of the |
36 |
| - database server or to gain OS-level access under the permissions of the |
37 |
| - <productname>PostgreSQL</productname> server process, as a C function can do. |
38 |
| - Thus, any unprivileged database user may be |
39 |
| - permitted to use this language. |
| 34 | + One compelling <emphasis>good</emphasis> restriction is that |
| 35 | + everything is executed from within the safety of the context of a |
| 36 | + Tcl interpreter. In addition to the limited command set of safe |
| 37 | + Tcl, only a few commands are available to access the database via |
| 38 | + SPI and to raise messages via <function>elog()</>. PL/Tcl |
| 39 | + provides no way to access internals of the database server or to |
| 40 | + gain OS-level access under the permissions of the |
| 41 | + <productname>PostgreSQL</productname> server process, as a C |
| 42 | + function can do. Thus, unprivileged database users may be trusted |
| 43 | + to use this language; it does not give them unlimited authority. |
40 | 44 | </para>
|
41 | 45 | <para>
|
42 |
| - The other, implementation restriction is that Tcl functions cannot |
43 |
| - be used to create input/output functions for new data types. |
| 46 | + The other notable implementation restriction is that Tcl functions |
| 47 | + may not be used to create input/output functions for new data |
| 48 | + types. |
44 | 49 | </para>
|
45 | 50 | <para>
|
46 | 51 | Sometimes it is desirable to write Tcl functions that are not restricted
|
|
55 | 60 | a user logged in as the database administrator.
|
56 | 61 | </para>
|
57 | 62 | <para>
|
58 |
| - The shared object for the <application>PL/Tcl</> and <application>PL/TclU</> call handlers is |
59 |
| - automatically built and installed in the |
60 |
| - <productname>PostgreSQL</productname> |
61 |
| - library directory if Tcl support is specified |
62 |
| - in the configuration step of the installation procedure. To install |
63 |
| - <application>PL/Tcl</> and/or <application>PL/TclU</> in a particular database, use the |
| 63 | + The shared object code for the <application>PL/Tcl</> and |
| 64 | + <application>PL/TclU</> call handlers is automatically built and |
| 65 | + installed in the <productname>PostgreSQL</productname> library |
| 66 | + directory if Tcl support is specified in the configuration step of |
| 67 | + the installation procedure. To install <application>PL/Tcl</> |
| 68 | + and/or <application>PL/TclU</> in a particular database, use the |
64 | 69 | <command>createlang</command> program, for example
|
65 | 70 | <literal>createlang pltcl <replaceable>dbname</></literal> or
|
66 | 71 | <literal>createlang pltclu <replaceable>dbname</></literal>.
|
|
0 commit comments