aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-06-04 23:27:23 +0000
committerBruce Momjian <bruce@momjian.us>2001-06-04 23:27:23 +0000
commit28d2420eefdacfa928138d4b302fd6a31286225b (patch)
tree73df5116c5775c04e5e0fbc628e38611d6dd6851 /doc/src
parent0a93285d88136df76b88247c5b5ddf3d4b418be4 (diff)
downloadpostgresql-28d2420eefdacfa928138d4b302fd6a31286225b.tar.gz
postgresql-28d2420eefdacfa928138d4b302fd6a31286225b.zip
This patch adds support for %TYPE in CREATE FUNCTION argument and return
types. This version has an elog() to remind the user the type resolution is not dynamic. Ian Lance Taylor
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/create_function.sgml18
1 files changed, 13 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml
index b95c2fd24e6..2a28925dff5 100644
--- a/doc/src/sgml/ref/create_function.sgml
+++ b/doc/src/sgml/ref/create_function.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.23 2001/05/19 09:01:10 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.24 2001/06/04 23:27:23 momjian Exp $
-->
<refentry id="SQL-CREATEFUNCTION">
@@ -55,10 +55,16 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
<listitem>
<para>
The data type(s) of the function's arguments, if any. The
- input types may be base or complex types, or
- <literal>opaque</literal>. <literal>Opaque</literal> indicates
+ input types may be base or complex types,
+ <literal>opaque</literal>, or the same as the type of an
+ existing column. <literal>Opaque</literal> indicates
that the function accepts arguments of a non-SQL type such as
<type>char *</type>.
+ The type of a column is indicated using <replaceable
+ class="parameter">tablename</replaceable>.<replaceable
+ class="parameter">columnname</replaceable><literal>%TYPE</literal>;
+ using this can sometimes help make a function independent from
+ changes to the definition of a table.
</para>
</listitem>
</varlistentry>
@@ -69,8 +75,10 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
<listitem>
<para>
The return data type. The output type may be specified as a
- base type, complex type, <literal>setof</literal> type, or
- <literal>opaque</literal>. The <literal>setof</literal>
+ base type, complex type, <literal>setof</literal> type,
+ <literal>opaque</literal>, or the same as the type of an
+ existing column.
+ The <literal>setof</literal>
modifier indicates that the function will return a set of
items, rather than a single item. Functions with a declared
return type of <literal>opaque</literal> do not return a value.