|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/xplang.sgml,v 1.35 2009/09/22 23:43:37 tgl Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/xplang.sgml,v 1.36 2009/12/19 01:49:02 tgl Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="xplang">
|
4 | 4 | <title id="xplang-title">Procedural Languages</title>
|
|
33 | 33 | <application>PL/Python</application> (<xref linkend="plpython">).
|
34 | 34 | There are additional procedural languages available that are not
|
35 | 35 | included in the core distribution. <xref linkend="external-projects">
|
36 |
| - has information about finding them. In addition other languages can |
37 |
| - be defined by users; the basics of developing a new procedural |
| 36 | + has information about finding them. In addition other languages can |
| 37 | + be defined by users; the basics of developing a new procedural |
38 | 38 | language are covered in <xref linkend="plhandler">.
|
39 | 39 | </para>
|
40 | 40 |
|
|
59 | 59 | current database. Alternatively, the program <xref
|
60 | 60 | linkend="app-createlang"> can be used to do this from the shell
|
61 | 61 | command line. For example, to install the language
|
62 |
| - <application>PL/pgSQL</application> into the database |
| 62 | + <application>PL/Perl</application> into the database |
63 | 63 | <literal>template1</>, use:
|
64 | 64 | <programlisting>
|
65 |
| -createlang plpgsql template1 |
| 65 | +createlang plperl template1 |
66 | 66 | </programlisting>
|
67 | 67 | The manual procedure described below is only recommended for
|
68 | 68 | installing custom languages that <command>CREATE LANGUAGE</command>
|
@@ -173,59 +173,64 @@ CREATE <optional>TRUSTED</optional> <optional>PROCEDURAL</optional> LANGUAGE <re
|
173 | 173 | <para>
|
174 | 174 | <xref linkend="xplang-install-example"> shows how the manual
|
175 | 175 | installation procedure would work with the language
|
176 |
| - <application>PL/pgSQL</application>. |
| 176 | + <application>PL/Perl</application>. |
177 | 177 | </para>
|
178 | 178 |
|
179 | 179 | <example id="xplang-install-example">
|
180 |
| - <title>Manual Installation of <application>PL/pgSQL</application></title> |
| 180 | + <title>Manual Installation of <application>PL/Perl</application></title> |
181 | 181 |
|
182 | 182 | <para>
|
183 |
| - The following command tells the database server where to find the |
184 |
| - shared object for the <application>PL/pgSQL</application> language's call handler function. |
| 183 | + The following command tells the database server where to find the |
| 184 | + shared object for the <application>PL/Perl</application> language's call |
| 185 | + handler function: |
185 | 186 |
|
186 | 187 | <programlisting>
|
187 |
| -CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler AS |
188 |
| - '$libdir/plpgsql' LANGUAGE C; |
| 188 | +CREATE FUNCTION plperl_call_handler() RETURNS language_handler AS |
| 189 | + '$libdir/plperl' LANGUAGE C; |
189 | 190 | </programlisting>
|
190 | 191 | </para>
|
191 | 192 |
|
192 | 193 | <para>
|
193 |
| - <application>PL/pgSQL</application> has an inline handler function |
| 194 | + <application>PL/Perl</application> has an inline handler function |
194 | 195 | and a validator function, so we declare those too:
|
195 | 196 |
|
196 | 197 | <programlisting>
|
197 |
| -CREATE FUNCTION plpgsql_inline_handler(internal) RETURNS void AS |
198 |
| - '$libdir/plpgsql' LANGUAGE C; |
| 198 | +CREATE FUNCTION plperl_inline_handler(internal) RETURNS void AS |
| 199 | + '$libdir/plperl' LANGUAGE C; |
199 | 200 |
|
200 |
| -CREATE FUNCTION plpgsql_validator(oid) RETURNS void AS |
201 |
| - '$libdir/plpgsql' LANGUAGE C; |
| 201 | +CREATE FUNCTION plperl_validator(oid) RETURNS void AS |
| 202 | + '$libdir/plperl' LANGUAGE C; |
202 | 203 | </programlisting>
|
203 | 204 | </para>
|
204 | 205 |
|
205 | 206 | <para>
|
206 | 207 | The command:
|
207 | 208 | <programlisting>
|
208 |
| -CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql |
209 |
| - HANDLER plpgsql_call_handler |
210 |
| - INLINE plpgsql_inline_handler |
211 |
| - VALIDATOR plpgsql_validator; |
| 209 | +CREATE TRUSTED PROCEDURAL LANGUAGE plperl |
| 210 | + HANDLER plperl_call_handler |
| 211 | + INLINE plperl_inline_handler |
| 212 | + VALIDATOR plperl_validator; |
212 | 213 | </programlisting>
|
213 | 214 | then defines that the previously declared functions
|
214 | 215 | should be invoked for functions and trigger procedures where the
|
215 |
| - language attribute is <literal>plpgsql</literal>. |
| 216 | + language attribute is <literal>plperl</literal>. |
216 | 217 | </para>
|
217 | 218 | </example>
|
218 | 219 |
|
219 | 220 | <para>
|
220 | 221 | In a default <productname>PostgreSQL</productname> installation,
|
221 | 222 | the handler for the <application>PL/pgSQL</application> language
|
222 | 223 | is built and installed into the <quote>library</quote>
|
223 |
| - directory. If <application>Tcl</> support is configured in, the handlers |
224 |
| - for <application>PL/Tcl</> and <application>PL/TclU</> are also built and |
225 |
| - installed in the same location. Likewise, the <application>PL/Perl</> and |
226 |
| - <application>PL/PerlU</> handlers are built and installed if Perl support |
227 |
| - is configured, and the <application>PL/PythonU</> handler is |
228 |
| - installed if Python support is configured. |
| 224 | + directory; furthermore, the <application>PL/pgSQL</application> language |
| 225 | + itself is installed in all databases. |
| 226 | + If <application>Tcl</> support is configured in, the handlers for |
| 227 | + <application>PL/Tcl</> and <application>PL/TclU</> are built and installed |
| 228 | + in the library directory, but the language itself is not installed in any |
| 229 | + database by default. |
| 230 | + Likewise, the <application>PL/Perl</> and <application>PL/PerlU</> |
| 231 | + handlers are built and installed if Perl support is configured, and the |
| 232 | + <application>PL/PythonU</> handler is installed if Python support is |
| 233 | + configured, but these languages are not installed by default. |
229 | 234 | </para>
|
230 | 235 |
|
231 | 236 | </sect1>
|
|
0 commit comments