1
1
<!--
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 $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -23,7 +23,7 @@ PostgreSQL documentation
23
23
<synopsis>
24
24
CREATE [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</replaceable>
25
25
CREATE [ 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> ]
27
27
</synopsis>
28
28
</refsynopsisdiv>
29
29
@@ -133,7 +133,7 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</
133
133
<para>
134
134
<replaceable class="parameter">call_handler</replaceable> is
135
135
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
137
137
handler for a procedural language must be written in a compiled
138
138
language such as C with version 1 call convention and
139
139
registered with <productname>PostgreSQL</productname> as a
@@ -144,6 +144,27 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</
144
144
</listitem>
145
145
</varlistentry>
146
146
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
+
147
168
<varlistentry>
148
169
<term><literal>VALIDATOR</literal> <replaceable class="parameter">valfunction</replaceable></term>
149
170
@@ -216,7 +237,8 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</
216
237
</para>
217
238
218
239
<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)
220
242
must already exist if the server does not have an entry for the language
221
243
in <structname>pg_pltemplate</>. But when there is an entry,
222
244
the functions need not already exist;
@@ -230,7 +252,7 @@ CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">name</
230
252
In <productname>PostgreSQL</productname> versions before 7.3, it was
231
253
necessary to declare handler functions as returning the placeholder
232
254
type <type>opaque</>, rather than <type>language_handler</>.
233
- To support loading
255
+ To support loading
234
256
of old dump files, <command>CREATE LANGUAGE</> will accept a function
235
257
declared as returning <type>opaque</>, but it will issue a notice and
236
258
change the function's declared return type to <type>language_handler</>.
0 commit comments