Update documentation to reflect that standard PLs are now extensions.
authorTom Lane
Sat, 5 Mar 2011 06:08:38 +0000 (01:08 -0500)
committerTom Lane
Sat, 5 Mar 2011 06:08:38 +0000 (01:08 -0500)
Recommend use of CREATE EXTENSION rather than plain CREATE LANGUAGE
where relevant.  Encourage PL authors to provide extension wrappers
for their PLs.

doc/src/sgml/installation.sgml
doc/src/sgml/plhandler.sgml
doc/src/sgml/plperl.sgml
doc/src/sgml/plpython.sgml
doc/src/sgml/pltcl.sgml
doc/src/sgml/ref/create_language.sgml
doc/src/sgml/ref/drop_language.sgml
doc/src/sgml/xplang.sgml

index 8400ce5d70bdf50f82138954277e4580112c2b25..b2d6990f783ebeada346461a30882f158f2b1297 100644 (file)
@@ -2601,8 +2601,8 @@ cc-1020 cc: ERROR File = pqcomm.c, Line = 427
    
      To build 64 bit binaries using MinGW, install the 64 bit tool set
      from , put its bin
-     directory in the PATH, and run 
-     configure with the  
+     directory in the PATH, and run
+     configure with the
      --host=x86_64-w64-mingw option.
    
 
index 6cddf002fbed5dcf03696d0f3f957adde832b2a1..20021bce6504f9feaccd103a99e2d9a848a5836f 100644 (file)
@@ -216,6 +216,15 @@ CREATE LANGUAGE plsample
     should execute this code and return.
    
 
+   
+    It's recommended that you wrap all these function declarations,
+    as well as the CREATE LANGUAGE command itself, into
+    an extension so that a simple CREATE EXTENSION
+    command is sufficient to install the language.  See
+     for information about writing
+    extensions.
+   
+
    
     The procedural languages included in the standard distribution
     are good references when trying to write your own language handler.
index a481accd8688a2f232f2bd93e603519d0f7b69d0..16984aab6340f41a26fb535a513f8b9d97e12fcc 100644 (file)
@@ -27,6 +27,7 @@
 
   
    To install PL/Perl in a particular database, use
+   CREATE EXTENSION plperl, or from the shell command line use
    createlang plperl dbname.
   
 
@@ -127,9 +128,9 @@ $$ LANGUAGE plperl;
 
   
     
-      Arguments will be converted from the database's encoding to UTF-8 
-      for use inside plperl, and then converted from UTF-8 back to the 
-      database encoding upon return. 
+      Arguments will be converted from the database's encoding to UTF-8
+      for use inside plperl, and then converted from UTF-8 back to the
+      database encoding upon return.
     
   
 
@@ -967,8 +968,7 @@ $$ LANGUAGE plperl;
    mail.  To handle these cases, PL/Perl can also be installed as an
    untrusted language (usually called
    PL/PerlUPL/PerlU).
-   In this case the full Perl language is available.  If the
-   createlang program is used to install the
+   In this case the full Perl language is available.  When installing the
    language, the language name plperlu will select
    the untrusted PL/Perl variant.
   
index a729fa3e1776681c724a0e863aee861f5f518a49..0aa5159e2b78d3933a013f37cf0bbf99495b5b25 100644 (file)
@@ -14,6 +14,7 @@
 
  
   To install PL/Python in a particular database, use
+  CREATE EXTENSION plpythonu, or from the shell command line use
   createlang plpythonu dbname (but
   see also ).
  
index 052a158fa98f4d5ad5e7b9182ed608709ec70050..4215f192ba54251fa2bbaaaeb8aad30cb5689f9d 100644 (file)
@@ -66,6 +66,7 @@
     directory if Tcl support is specified in the configuration step of
     the installation procedure.  To install PL/Tcl
     and/or PL/TclU in a particular database, use the
+    CREATE EXTENSION command or the
     createlang program, for example
     createlang pltcl dbname or
     createlang pltclu dbname.
index c9cb95cae595bf439bdba0561e71e4f0bbe5f679..13c3baf993c4ad521dda676e12ee35a1a38dd462 100644 (file)
@@ -37,6 +37,21 @@ CREATE [ OR REPLACE ] [ TRUSTED ] [ PROCEDURAL ] LANGUAGE 
    defined in this new language.
   
 
+  
+   
+    As of PostgreSQL 9.1, most procedural
+    languages have been made into extensions, and should
+    therefore be installed with 
+    not CREATE LANGUAGE.  Direct use of
+    CREATE LANGUAGE should now be confined to
+    extension installation scripts.  If you have a bare
+    language in your database, perhaps as a result of an upgrade,
+    you can convert it to an extension using
+    CREATE EXTENSION langname FROM
+    unpackaged.
+   
+  
+
   
    CREATE LANGUAGE effectively associates the
    language name with handler function(s) that are responsible for executing
index 6bf900e25469d5882c7f99a0835db02317b1da58..21c9e5aced632021d45e2a91114510366cf629eb 100644 (file)
@@ -33,6 +33,15 @@ DROP [ PROCEDURAL ] LANGUAGE [ IF EXISTS ] name
    previously registered procedural language.  You must be a superuser
    or the owner of the language to use DROP LANGUAGE.
   
+
+  
+   
+    As of PostgreSQL 9.1, most procedural
+    languages have been made into extensions, and should
+    therefore be removed with 
+    not DROP LANGUAGE.
+   
+  
  
 
  
index 0aef3bf4b3d6fd4d86b9735a78ea713714c8cbee..68220bf63343f4e956c888b822875729bbb0b1d8 100644 (file)
@@ -54,7 +54,7 @@
 
    
     For the languages supplied with the standard distribution, it is
-    only necessary to execute CREATE LANGUAGE
+    only necessary to execute CREATE EXTENSION
     language_name to install the language into the
     current database.  Alternatively, the program 
     linkend="app-createlang"> can be used to do this from the shell
@@ -65,8 +65,7 @@
 createlang plperl template1
 
     The manual procedure described below is only recommended for
-    installing custom languages that CREATE LANGUAGE
-    does not know about.
+    installing languages that have not been packaged as extensions.
    
 
    
@@ -76,10 +75,10 @@ createlang plperl template1
 
     
      A procedural language is installed in a database in five steps,
-     which must be carried out by a database superuser.  (For languages
-     known to CREATE LANGUAGE, the second through fourth steps
-     can be omitted, because they will be carried out automatically
-     if needed.)
+     which must be carried out by a database superuser.  In most cases
+     the required SQL commands should be packaged as the installation script
+     of an extension, so that CREATE EXTENSION can be
+     used to execute them.
     
 
     
@@ -136,14 +135,14 @@ CREATE FUNCTION inline_function_name(internal)
 CREATE FUNCTION validator_function_name(oid)
     RETURNS void
     AS 'path-to-shared-object'
-    LANGUAGE C;
+    LANGUAGE C STRICT;
 
      
     
 
     
      
-      The PL must be declared with the command
+      Finally, the PL must be declared with the command
 
 CREATE TRUSTED PROCEDURAL LANGUAGE language-name
     HANDLER handler_function_name
@@ -154,7 +153,7 @@ CREATE TRUSTED PROCEDURAL LANGUAGE 
       the language does not grant access to data that the user would
       not otherwise have.  Trusted languages are designed for ordinary
       database users (those without superuser privilege) and allows them
-      to safely create of functions and trigger
+      to safely create functions and trigger
       procedures. Since PL functions are executed inside the database
       server, the TRUSTED flag should only be given
       for languages that do not allow access to database server
@@ -201,7 +200,7 @@ CREATE FUNCTION plperl_inline_handler(internal) RETURNS void AS
     '$libdir/plperl' LANGUAGE C;
 
 CREATE FUNCTION plperl_validator(oid) RETURNS void AS
-    '$libdir/plperl' LANGUAGE C;
+    '$libdir/plperl' LANGUAGE C STRICT;