Commit 2e83e6bd authored by Tom Lane's avatar Tom Lane

Adjust hints and docs to suggest CREATE EXTENSION not CREATE LANGUAGE.

The core PLs have been extension-ified for seven years now, and we can
reasonably hope that all out-of-core PLs have been too.  So adjust a few
places that were still recommending CREATE LANGUAGE as the user-level
way to install a PL.

Discussion: https://postgr.es/m/CA+TgmoaJTUDMSuSCg4k08Dv8vhbrJq9nP3ZfPbmysVz_616qxw@mail.gmail.com
parent 76ece169
...@@ -157,7 +157,7 @@ CREATE [ OR REPLACE ] TRANSFORM FOR <replaceable>type_name</replaceable> LANGUAG ...@@ -157,7 +157,7 @@ CREATE [ OR REPLACE ] TRANSFORM FOR <replaceable>type_name</replaceable> LANGUAG
<programlisting> <programlisting>
CREATE TYPE hstore ...; CREATE TYPE hstore ...;
CREATE LANGUAGE plpythonu ...; CREATE EXTENSION plpythonu;
</programlisting> </programlisting>
Then create the necessary functions: Then create the necessary functions:
<programlisting> <programlisting>
...@@ -176,7 +176,7 @@ CREATE TRANSFORM FOR hstore LANGUAGE plpythonu ( ...@@ -176,7 +176,7 @@ CREATE TRANSFORM FOR hstore LANGUAGE plpythonu (
TO SQL WITH FUNCTION plpython_to_hstore(internal) TO SQL WITH FUNCTION plpython_to_hstore(internal)
); );
</programlisting> </programlisting>
In practice, these commands would be wrapped up in extensions. In practice, these commands would be wrapped up in an extension.
</para> </para>
<para> <para>
......
...@@ -81,7 +81,7 @@ DO [ LANGUAGE <replaceable class="parameter">lang_name</replaceable> ] <replacea ...@@ -81,7 +81,7 @@ DO [ LANGUAGE <replaceable class="parameter">lang_name</replaceable> ] <replacea
<para> <para>
The procedural language to be used must already have been installed The procedural language to be used must already have been installed
into the current database by means of <command>CREATE LANGUAGE</command>. into the current database by means of <command>CREATE EXTENSION</command>.
<literal>plpgsql</literal> is installed by default, but other languages are not. <literal>plpgsql</literal> is installed by default, but other languages are not.
</para> </para>
......
...@@ -934,7 +934,7 @@ CreateFunction(ParseState *pstate, CreateFunctionStmt *stmt) ...@@ -934,7 +934,7 @@ CreateFunction(ParseState *pstate, CreateFunctionStmt *stmt)
(errcode(ERRCODE_UNDEFINED_OBJECT), (errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("language \"%s\" does not exist", language), errmsg("language \"%s\" does not exist", language),
(PLTemplateExists(language) ? (PLTemplateExists(language) ?
errhint("Use CREATE LANGUAGE to load the language into the database.") : 0))); errhint("Use CREATE EXTENSION to load the language into the database.") : 0)));
languageOid = HeapTupleGetOid(languageTuple); languageOid = HeapTupleGetOid(languageTuple);
languageStruct = (Form_pg_language) GETSTRUCT(languageTuple); languageStruct = (Form_pg_language) GETSTRUCT(languageTuple);
...@@ -2136,7 +2136,7 @@ ExecuteDoStmt(DoStmt *stmt, bool atomic) ...@@ -2136,7 +2136,7 @@ ExecuteDoStmt(DoStmt *stmt, bool atomic)
(errcode(ERRCODE_UNDEFINED_OBJECT), (errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("language \"%s\" does not exist", language), errmsg("language \"%s\" does not exist", language),
(PLTemplateExists(language) ? (PLTemplateExists(language) ?
errhint("Use CREATE LANGUAGE to load the language into the database.") : 0))); errhint("Use CREATE EXTENSION to load the language into the database.") : 0)));
codeblock->langOid = HeapTupleGetOid(languageTuple); codeblock->langOid = HeapTupleGetOid(languageTuple);
languageStruct = (Form_pg_language) GETSTRUCT(languageTuple); languageStruct = (Form_pg_language) GETSTRUCT(languageTuple);
......
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