1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Make LANCOMPILER clause in CREATE LANGUAGE optional. Allow "identifier"

syntax for language names (instead of 'string').

createlang now handles the case where a second language uses the same call
handler as an already installed language (e.g., plperl/plperlu).

droplang now handles the reverse case, i.e., dropping a language where
the call handler is still used by another language.  Moreover, droplang
can now be used to drop any user-defined language, not just the supplied
ones.
This commit is contained in:
Peter Eisentraut
2001-08-13 21:34:54 +00:00
parent 38cfc95865
commit ee8ed85da3
7 changed files with 118 additions and 123 deletions

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_language.sgml,v 1.14 2000/11/20 20:36:46 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_language.sgml,v 1.15 2001/08/13 21:34:51 petere Exp $
Postgres documentation
-->
@ -23,9 +23,8 @@ Postgres documentation
<date>1999-07-20</date>
</refsynopsisdivinfo>
<synopsis>
CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE '<replaceable class="parameter">langname</replaceable>'
CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">langname</replaceable>
HANDLER <replaceable class="parameter">call_handler</replaceable>
LANCOMPILER '<replaceable class="parameter">comment</replaceable>'
</synopsis>
<refsect2 id="R2-SQL-CREATELANGUAGE-1">
@ -62,6 +61,10 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE '<replaceable class="parameter">langn
language cannot override one of the built-in languages of
<productname>Postgres</productname>.
</para>
<para>
For backward compatibility, the name may be enclosed by single
quotes.
</para>
</listitem>
</varlistentry>
@ -77,20 +80,6 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE '<replaceable class="parameter">langn
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">comment</replaceable></term>
<listitem>
<para>
The <function>LANCOMPILER</function> argument is the
string that will be
inserted in the <literal>LANCOMPILER</literal> attribute
of the new
<filename>pg_language</filename> entry. At present,
<productname>Postgres</productname> does not use
this attribute in any way.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
@ -346,10 +335,9 @@ plsample_call_handler(PG_FUNCTION_ARGS)
<programlisting>
CREATE FUNCTION plsample_call_handler () RETURNS opaque
AS '/usr/local/pgsql/lib/plsample.so'
LANGUAGE 'C';
CREATE PROCEDURAL LANGUAGE 'plsample'
HANDLER plsample_call_handler
LANCOMPILER 'PL/Sample';
LANGUAGE C;
CREATE LANGUAGE plsample
HANDLER plsample_call_handler;
</programlisting>
</para>
</refsect1>