From c43d26c1af6405331a15df5d4867cea63127ccfe Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 19 Dec 2009 01:49:02 +0000 Subject: [PATCH] Adjust some more places in the documentation to match the fact that plpgsql is now installed by default. --- doc/src/sgml/manage-ag.sgml | 4 +- doc/src/sgml/plpgsql.sgml | 9 +++- doc/src/sgml/ref/create_language.sgml | 4 +- doc/src/sgml/xplang.sgml | 59 +++++++++++++++------------ 4 files changed, 44 insertions(+), 32 deletions(-) diff --git a/doc/src/sgml/manage-ag.sgml b/doc/src/sgml/manage-ag.sgml index 8712e5c978..e3731d0293 100644 --- a/doc/src/sgml/manage-ag.sgml +++ b/doc/src/sgml/manage-ag.sgml @@ -1,4 +1,4 @@ - + Managing Databases @@ -184,7 +184,7 @@ createdb -O rolename 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 PL/pgSQL in template1, it will + language PL/Perl in template1, it will automatically be available in user databases without any extra action being taken when those databases are made. diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index 6a3c8fa404..6673173439 100644 --- a/doc/src/sgml/plpgsql.sgml +++ b/doc/src/sgml/plpgsql.sgml @@ -1,4 +1,4 @@ - + <application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language @@ -58,6 +58,13 @@ them to define operators or use them in index expressions. + + In PostgreSQL 8.5 and later, + PL/pgSQL is installed by default. + However it is still a loadable module, so especially security-conscious + administrators could choose to remove it. + + Advantages of Using <application>PL/pgSQL</application> diff --git a/doc/src/sgml/ref/create_language.sgml b/doc/src/sgml/ref/create_language.sgml index f87308edb3..457af69183 100644 --- a/doc/src/sgml/ref/create_language.sgml +++ b/doc/src/sgml/ref/create_language.sgml @@ -1,5 +1,5 @@ @@ -266,7 +266,7 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE name -CREATE LANGUAGE plpgsql; +CREATE LANGUAGE plperl; diff --git a/doc/src/sgml/xplang.sgml b/doc/src/sgml/xplang.sgml index b48b78f95b..59d3050ee6 100644 --- a/doc/src/sgml/xplang.sgml +++ b/doc/src/sgml/xplang.sgml @@ -1,4 +1,4 @@ - + Procedural Languages @@ -33,8 +33,8 @@ PL/Python (). There are additional procedural languages available that are not included in the core distribution. - 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 . @@ -59,10 +59,10 @@ current database. Alternatively, the program can be used to do this from the shell command line. For example, to install the language - PL/pgSQL into the database + PL/Perl into the database template1, use: -createlang plpgsql template1 +createlang plperl template1 The manual procedure described below is only recommended for installing custom languages that CREATE LANGUAGE @@ -173,46 +173,47 @@ CREATE TRUSTED PROCEDURAL LANGUAGE shows how the manual installation procedure would work with the language - PL/pgSQL. + PL/Perl. - Manual Installation of <application>PL/pgSQL</application> + Manual Installation of <application>PL/Perl</application> - The following command tells the database server where to find the - shared object for the PL/pgSQL language's call handler function. + The following command tells the database server where to find the + shared object for the PL/Perl language's call + handler function: -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; - PL/pgSQL has an inline handler function + PL/Perl has an inline handler function and a validator function, so we declare those too: -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; The command: -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; then defines that the previously declared functions should be invoked for functions and trigger procedures where the - language attribute is plpgsql. + language attribute is plperl. @@ -220,12 +221,16 @@ CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql In a default PostgreSQL installation, the handler for the PL/pgSQL language is built and installed into the library - directory. If Tcl support is configured in, the handlers - for PL/Tcl and PL/TclU are also built and - installed in the same location. Likewise, the PL/Perl and - PL/PerlU handlers are built and installed if Perl support - is configured, and the PL/PythonU handler is - installed if Python support is configured. + directory; furthermore, the PL/pgSQL language + itself is installed in all databases. + If Tcl support is configured in, the handlers for + PL/Tcl and PL/TclU are built and installed + in the library directory, but the language itself is not installed in any + database by default. + Likewise, the PL/Perl and PL/PerlU + handlers are built and installed if Perl support is configured, and the + PL/PythonU handler is installed if Python support is + configured, but these languages are not installed by default.