11<!--
2- $PostgreSQL: pgsql/doc/src/sgml/ref/create_language.sgml,v 1.45 2008/11/14 10:22:46 petere Exp $
2+ $PostgreSQL: pgsql/doc/src/sgml/ref/create_language.sgml,v 1.46 2009/09/22 23:43:37 tgl Exp $
33PostgreSQL documentation
44-->
55
@@ -23,7 +23,7 @@ PostgreSQL documentation
2323<synopsis>
2424CREATE [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</replaceable>
2525CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</replaceable>
26- HANDLER <replaceable class="parameter">call_handler</replaceable> [ VALIDATOR <replaceable>valfunction</replaceable> ]
26+ HANDLER <replaceable class="parameter">call_handler</replaceable> [ INLINE <replaceable class="parameter">inline_handler</replaceable> ] [ VALIDATOR <replaceable>valfunction</replaceable> ]
2727</synopsis>
2828 </refsynopsisdiv>
2929
@@ -133,7 +133,7 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</
133133 <para>
134134 <replaceable class="parameter">call_handler</replaceable> is
135135 the name of a previously registered function that will be
136- called to execute the procedural language functions. The call
136+ called to execute the procedural language's functions. The call
137137 handler for a procedural language must be written in a compiled
138138 language such as C with version 1 call convention and
139139 registered with <productname>PostgreSQL</productname> as a
@@ -144,6 +144,27 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</
144144 </listitem>
145145 </varlistentry>
146146
147+ <varlistentry>
148+ <term><literal>INLINE</literal> <replaceable class="parameter">inline_handler</replaceable></term>
149+
150+ <listitem>
151+ <para>
152+ <replaceable class="parameter">inline_handler</replaceable> is the
153+ name of a previously registered function that will be called
154+ to execute an anonymous code block
155+ (<xref linkend="sql-do" endterm="sql-do-title"> command)
156+ in this language.
157+ If no <replaceable class="parameter">inline_handler</replaceable>
158+ function is specified, the language does not support anonymous code
159+ blocks.
160+ The handler function must take one argument of
161+ type <type>internal</type>, which will be the <command>DO</> command's
162+ internal representation, and it will typically return
163+ <type>void</>. The return value of the handler is ignored.
164+ </para>
165+ </listitem>
166+ </varlistentry>
167+
147168 <varlistentry>
148169 <term><literal>VALIDATOR</literal> <replaceable class="parameter">valfunction</replaceable></term>
149170
@@ -216,7 +237,8 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</
216237 </para>
217238
218239 <para>
219- The call handler function and the validator function (if any)
240+ The call handler function, the inline handler function (if any),
241+ and the validator function (if any)
220242 must already exist if the server does not have an entry for the language
221243 in <structname>pg_pltemplate</>. But when there is an entry,
222244 the functions need not already exist;
@@ -230,7 +252,7 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</
230252 In <productname>PostgreSQL</productname> versions before 7.3, it was
231253 necessary to declare handler functions as returning the placeholder
232254 type <type>opaque</>, rather than <type>language_handler</>.
233- To support loading
255+ To support loading
234256 of old dump files, <command>CREATE LANGUAGE</> will accept a function
235257 declared as returning <type>opaque</>, but it will issue a notice and
236258 change the function's declared return type to <type>language_handler</>.
0 commit comments