mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Adjust some more places in the documentation to match the fact that
plpgsql is now installed by default.
This commit is contained in:
parent
efc16ea520
commit
c43d26c1af
@ -1,4 +1,4 @@
|
||||
<!-- $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">
|
||||
<title>Managing Databases</title>
|
||||
@ -184,7 +184,7 @@ createdb -O <replaceable>rolename</> <replaceable>dbname</>
|
||||
will be copied into subsequently created user databases. This
|
||||
behavior allows site-local modifications to the standard set of
|
||||
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
|
||||
action being taken when those databases are made.
|
||||
</para>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!-- $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">
|
||||
<title><application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language</title>
|
||||
@ -58,6 +58,13 @@
|
||||
them to define operators or use them in index expressions.
|
||||
</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">
|
||||
<title>Advantages of Using <application>PL/pgSQL</application></title>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$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
|
||||
-->
|
||||
|
||||
@ -266,7 +266,7 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</
|
||||
The preferred way of creating any of the standard procedural languages
|
||||
is just:
|
||||
<programlisting>
|
||||
CREATE LANGUAGE plpgsql;
|
||||
CREATE LANGUAGE plperl;
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!-- $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">
|
||||
<title id="xplang-title">Procedural Languages</title>
|
||||
@ -33,8 +33,8 @@
|
||||
<application>PL/Python</application> (<xref linkend="plpython">).
|
||||
There are additional procedural languages available that are not
|
||||
included in the core distribution. <xref linkend="external-projects">
|
||||
has information about finding them. In addition other languages can
|
||||
be defined by users; the basics of developing a new procedural
|
||||
has information about finding them. In addition other languages can
|
||||
be defined by users; the basics of developing a new procedural
|
||||
language are covered in <xref linkend="plhandler">.
|
||||
</para>
|
||||
|
||||
@ -59,10 +59,10 @@
|
||||
current database. Alternatively, the program <xref
|
||||
linkend="app-createlang"> can be used to do this from the shell
|
||||
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:
|
||||
<programlisting>
|
||||
createlang plpgsql template1
|
||||
createlang plperl template1
|
||||
</programlisting>
|
||||
The manual procedure described below is only recommended for
|
||||
installing custom languages that <command>CREATE LANGUAGE</command>
|
||||
@ -173,46 +173,47 @@ CREATE <optional>TRUSTED</optional> <optional>PROCEDURAL</optional> LANGUAGE <re
|
||||
<para>
|
||||
<xref linkend="xplang-install-example"> shows how the manual
|
||||
installation procedure would work with the language
|
||||
<application>PL/pgSQL</application>.
|
||||
<application>PL/Perl</application>.
|
||||
</para>
|
||||
|
||||
<example id="xplang-install-example">
|
||||
<title>Manual Installation of <application>PL/pgSQL</application></title>
|
||||
<title>Manual Installation of <application>PL/Perl</application></title>
|
||||
|
||||
<para>
|
||||
The following command tells the database server where to find the
|
||||
shared object for the <application>PL/pgSQL</application> language's call handler function.
|
||||
The following command tells the database server where to find the
|
||||
shared object for the <application>PL/Perl</application> language's call
|
||||
handler function:
|
||||
|
||||
<programlisting>
|
||||
CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler AS
|
||||
'$libdir/plpgsql' LANGUAGE C;
|
||||
CREATE FUNCTION plperl_call_handler() RETURNS language_handler AS
|
||||
'$libdir/plperl' LANGUAGE C;
|
||||
</programlisting>
|
||||
</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:
|
||||
|
||||
<programlisting>
|
||||
CREATE FUNCTION plpgsql_inline_handler(internal) RETURNS void AS
|
||||
'$libdir/plpgsql' LANGUAGE C;
|
||||
CREATE FUNCTION plperl_inline_handler(internal) RETURNS void AS
|
||||
'$libdir/plperl' LANGUAGE C;
|
||||
|
||||
CREATE FUNCTION plpgsql_validator(oid) RETURNS void AS
|
||||
'$libdir/plpgsql' LANGUAGE C;
|
||||
CREATE FUNCTION plperl_validator(oid) RETURNS void AS
|
||||
'$libdir/plperl' LANGUAGE C;
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The command:
|
||||
<programlisting>
|
||||
CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql
|
||||
HANDLER plpgsql_call_handler
|
||||
INLINE plpgsql_inline_handler
|
||||
VALIDATOR plpgsql_validator;
|
||||
CREATE TRUSTED PROCEDURAL LANGUAGE plperl
|
||||
HANDLER plperl_call_handler
|
||||
INLINE plperl_inline_handler
|
||||
VALIDATOR plperl_validator;
|
||||
</programlisting>
|
||||
then defines that the previously declared functions
|
||||
should be invoked for functions and trigger procedures where the
|
||||
language attribute is <literal>plpgsql</literal>.
|
||||
language attribute is <literal>plperl</literal>.
|
||||
</para>
|
||||
</example>
|
||||
|
||||
@ -220,12 +221,16 @@ CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql
|
||||
In a default <productname>PostgreSQL</productname> installation,
|
||||
the handler for the <application>PL/pgSQL</application> language
|
||||
is built and installed into the <quote>library</quote>
|
||||
directory. If <application>Tcl</> support is configured in, the handlers
|
||||
for <application>PL/Tcl</> and <application>PL/TclU</> are also built and
|
||||
installed in the same location. 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.
|
||||
directory; furthermore, the <application>PL/pgSQL</application> language
|
||||
itself is installed in all databases.
|
||||
If <application>Tcl</> support is configured in, the handlers for
|
||||
<application>PL/Tcl</> and <application>PL/TclU</> are built and installed
|
||||
in the library directory, but the language itself is not installed in any
|
||||
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>
|
||||
|
||||
</sect1>
|
||||
|
Loading…
Reference in New Issue
Block a user