Commit c43d26c1 authored by Tom Lane's avatar Tom Lane

Adjust some more places in the documentation to match the fact that

plpgsql is now installed by default.
parent efc16ea5
<!-- $PostgreSQL: pgsql/doc/src/sgml/manage-ag.sgml,v 2.59 2009/12/10 06:32:27 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/manage-ag.sgml,v 2.60 2009/12/19 01:49:02 tgl Exp $ -->
<chapter id="managing-databases"> <chapter id="managing-databases">
<title>Managing Databases</title> <title>Managing Databases</title>
...@@ -184,7 +184,7 @@ createdb -O <replaceable>rolename</> <replaceable>dbname</> ...@@ -184,7 +184,7 @@ createdb -O <replaceable>rolename</> <replaceable>dbname</>
will be copied into subsequently created user databases. This will be copied into subsequently created user databases. This
behavior allows site-local modifications to the standard set of behavior allows site-local modifications to the standard set of
objects in databases. For example, if you install the procedural objects in databases. For example, if you install the procedural
language <application>PL/pgSQL</> in <literal>template1</>, it will language <application>PL/Perl</> in <literal>template1</>, it will
automatically be available in user databases without any extra automatically be available in user databases without any extra
action being taken when those databases are made. action being taken when those databases are made.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.147 2009/11/13 22:43:39 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.148 2009/12/19 01:49:02 tgl Exp $ -->
<chapter id="plpgsql"> <chapter id="plpgsql">
<title><application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language</title> <title><application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language</title>
...@@ -58,6 +58,13 @@ ...@@ -58,6 +58,13 @@
them to define operators or use them in index expressions. them to define operators or use them in index expressions.
</para> </para>
<para>
In <productname>PostgreSQL</> 8.5 and later,
<application>PL/pgSQL</application> is installed by default.
However it is still a loadable module, so especially security-conscious
administrators could choose to remove it.
</para>
<sect2 id="plpgsql-advantages"> <sect2 id="plpgsql-advantages">
<title>Advantages of Using <application>PL/pgSQL</application></title> <title>Advantages of Using <application>PL/pgSQL</application></title>
......
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/create_language.sgml,v 1.47 2009/10/08 04:41:07 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/create_language.sgml,v 1.48 2009/12/19 01:49:02 tgl Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -266,7 +266,7 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</ ...@@ -266,7 +266,7 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</
The preferred way of creating any of the standard procedural languages The preferred way of creating any of the standard procedural languages
is just: is just:
<programlisting> <programlisting>
CREATE LANGUAGE plpgsql; CREATE LANGUAGE plperl;
</programlisting> </programlisting>
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/xplang.sgml,v 1.35 2009/09/22 23:43:37 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/xplang.sgml,v 1.36 2009/12/19 01:49:02 tgl Exp $ -->
<chapter id="xplang"> <chapter id="xplang">
<title id="xplang-title">Procedural Languages</title> <title id="xplang-title">Procedural Languages</title>
...@@ -59,10 +59,10 @@ ...@@ -59,10 +59,10 @@
current database. Alternatively, the program <xref current database. Alternatively, the program <xref
linkend="app-createlang"> can be used to do this from the shell linkend="app-createlang"> can be used to do this from the shell
command line. For example, to install the language command line. For example, to install the language
<application>PL/pgSQL</application> into the database <application>PL/Perl</application> into the database
<literal>template1</>, use: <literal>template1</>, use:
<programlisting> <programlisting>
createlang plpgsql template1 createlang plperl template1
</programlisting> </programlisting>
The manual procedure described below is only recommended for The manual procedure described below is only recommended for
installing custom languages that <command>CREATE LANGUAGE</command> installing custom languages that <command>CREATE LANGUAGE</command>
...@@ -173,46 +173,47 @@ CREATE <optional>TRUSTED</optional> <optional>PROCEDURAL</optional> LANGUAGE <re ...@@ -173,46 +173,47 @@ CREATE <optional>TRUSTED</optional> <optional>PROCEDURAL</optional> LANGUAGE <re
<para> <para>
<xref linkend="xplang-install-example"> shows how the manual <xref linkend="xplang-install-example"> shows how the manual
installation procedure would work with the language installation procedure would work with the language
<application>PL/pgSQL</application>. <application>PL/Perl</application>.
</para> </para>
<example id="xplang-install-example"> <example id="xplang-install-example">
<title>Manual Installation of <application>PL/pgSQL</application></title> <title>Manual Installation of <application>PL/Perl</application></title>
<para> <para>
The following command tells the database server where to find the The following command tells the database server where to find the
shared object for the <application>PL/pgSQL</application> language's call handler function. shared object for the <application>PL/Perl</application> language's call
handler function:
<programlisting> <programlisting>
CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler AS CREATE FUNCTION plperl_call_handler() RETURNS language_handler AS
'$libdir/plpgsql' LANGUAGE C; '$libdir/plperl' LANGUAGE C;
</programlisting> </programlisting>
</para> </para>
<para> <para>
<application>PL/pgSQL</application> has an inline handler function <application>PL/Perl</application> has an inline handler function
and a validator function, so we declare those too: and a validator function, so we declare those too:
<programlisting> <programlisting>
CREATE FUNCTION plpgsql_inline_handler(internal) RETURNS void AS CREATE FUNCTION plperl_inline_handler(internal) RETURNS void AS
'$libdir/plpgsql' LANGUAGE C; '$libdir/plperl' LANGUAGE C;
CREATE FUNCTION plpgsql_validator(oid) RETURNS void AS CREATE FUNCTION plperl_validator(oid) RETURNS void AS
'$libdir/plpgsql' LANGUAGE C; '$libdir/plperl' LANGUAGE C;
</programlisting> </programlisting>
</para> </para>
<para> <para>
The command: The command:
<programlisting> <programlisting>
CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql CREATE TRUSTED PROCEDURAL LANGUAGE plperl
HANDLER plpgsql_call_handler HANDLER plperl_call_handler
INLINE plpgsql_inline_handler INLINE plperl_inline_handler
VALIDATOR plpgsql_validator; VALIDATOR plperl_validator;
</programlisting> </programlisting>
then defines that the previously declared functions then defines that the previously declared functions
should be invoked for functions and trigger procedures where the should be invoked for functions and trigger procedures where the
language attribute is <literal>plpgsql</literal>. language attribute is <literal>plperl</literal>.
</para> </para>
</example> </example>
...@@ -220,12 +221,16 @@ CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql ...@@ -220,12 +221,16 @@ CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql
In a default <productname>PostgreSQL</productname> installation, In a default <productname>PostgreSQL</productname> installation,
the handler for the <application>PL/pgSQL</application> language the handler for the <application>PL/pgSQL</application> language
is built and installed into the <quote>library</quote> is built and installed into the <quote>library</quote>
directory. If <application>Tcl</> support is configured in, the handlers directory; furthermore, the <application>PL/pgSQL</application> language
for <application>PL/Tcl</> and <application>PL/TclU</> are also built and itself is installed in all databases.
installed in the same location. Likewise, the <application>PL/Perl</> and If <application>Tcl</> support is configured in, the handlers for
<application>PL/PerlU</> handlers are built and installed if Perl support <application>PL/Tcl</> and <application>PL/TclU</> are built and installed
is configured, and the <application>PL/PythonU</> handler is in the library directory, but the language itself is not installed in any
installed if Python support is configured. database by default.
Likewise, the <application>PL/Perl</> and <application>PL/PerlU</>
handlers are built and installed if Perl support is configured, and the
<application>PL/PythonU</> handler is installed if Python support is
configured, but these languages are not installed by default.
</para> </para>
</sect1> </sect1>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment