aboutsummaryrefslogtreecommitdiff
path: root/doc/src/sgml/ref/create_function.sgml
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2015-04-26 10:33:14 -0400
committerPeter Eisentraut <peter_e@gmx.net>2015-04-26 10:33:14 -0400
commitcac76582053ef8ea07df65fed0757f352da23705 (patch)
tree6ae01041aa61db9d686638b9d4c3ccd30d7c6487 /doc/src/sgml/ref/create_function.sgml
parentf320cbb615e0374b18836337713239da58705cf3 (diff)
downloadpostgresql-cac76582053ef8ea07df65fed0757f352da23705.tar.gz
postgresql-cac76582053ef8ea07df65fed0757f352da23705.zip
Add transforms feature
This provides a mechanism for specifying conversions between SQL data types and procedural languages. As examples, there are transforms for hstore and ltree for PL/Perl and PL/Python. reviews by Pavel Stěhule and Andres Freund
Diffstat (limited to 'doc/src/sgml/ref/create_function.sgml')
-rw-r--r--doc/src/sgml/ref/create_function.sgml18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml
index 20019215351..c5beb166cfa 100644
--- a/doc/src/sgml/ref/create_function.sgml
+++ b/doc/src/sgml/ref/create_function.sgml
@@ -25,6 +25,7 @@ CREATE [ OR REPLACE ] FUNCTION
[ RETURNS <replaceable class="parameter">rettype</replaceable>
| RETURNS TABLE ( <replaceable class="parameter">column_name</replaceable> <replaceable class="parameter">column_type</replaceable> [, ...] ) ]
{ LANGUAGE <replaceable class="parameter">lang_name</replaceable>
+ | TRANSFORM { FOR TYPE <replaceable class="parameter">type_name</replaceable> } [, ... ]
| WINDOW
| IMMUTABLE | STABLE | VOLATILE | [ NOT ] LEAKPROOF
| CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT
@@ -261,6 +262,23 @@ CREATE [ OR REPLACE ] FUNCTION
</varlistentry>
<varlistentry>
+ <term><literal>TRANSFORM { FOR TYPE <replaceable class="parameter">type_name</replaceable> } [, ... ] }</literal></term>
+
+ <listitem>
+ <para>
+ Lists which transforms a call to the function should apply. Transforms
+ convert between SQL types and language-specific data types;
+ see <xref linkend="sql-createtransform">. Procedural language
+ implementations usually have hardcoded knowledge of the built-in types,
+ so those don't need to be listed here. If a procedural language
+ implementation does not know how to handle a type and no transform is
+ supplied, it will fall back to a default behavior for converting data
+ types, but this depends on the implementation.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><literal>WINDOW</literal></term>
<listitem>