diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-03-20 04:41:13 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-03-20 04:41:13 +0000 |
commit | 7d1d7200a0fb9bfdaafefddbe35b27515ee2e11b (patch) | |
tree | afd5d51914a3e5085de14af5f2e7790b6ef272ba /doc/src/sgml/ref/create_function.sgml | |
parent | ee303739d3dd9439f0cec2f46519d6fb02989f31 (diff) | |
download | postgresql-7d1d7200a0fb9bfdaafefddbe35b27515ee2e11b.tar.gz postgresql-7d1d7200a0fb9bfdaafefddbe35b27515ee2e11b.zip |
Minor doc patch: create function
Gavin Sherry
Diffstat (limited to 'doc/src/sgml/ref/create_function.sgml')
-rw-r--r-- | doc/src/sgml/ref/create_function.sgml | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml index 71c09e6ef5b..2a6ca11c4b9 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.44 2003/01/19 00:13:29 momjian Exp $ +$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.45 2003/03/20 04:41:13 momjian Exp $ --> <refentry id="SQL-CREATEFUNCTION"> @@ -66,18 +66,22 @@ CREATE [ OR REPLACE ] FUNCTION <replaceable class="parameter">name</replaceable> <listitem> <para> - The data type(s) of the function's arguments, if any. The - input types may be base, complex, or domain types, - or the same as the type of an existing column. - The type of a column is referenced by writing <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. - Depending on the implementation language it may also be allowed - to specify <quote>pseudo-types</> such as <type>cstring</>. - Pseudo-types indicate that the actual argument type is either - incompletely specified, or outside the set of ordinary SQL data types. + The data type(s) of the function's arguments (optionally + schema-qualified), if any. The input types may be base, complex, or + domain types, or the same as the type of an existing column. + </para> + <para> + The type of a column is referenced by writing <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> + <para> + Depending on the implementation language it may also be allowed + to specify <quote>pseudo-types</> such as <type>cstring</>. + Pseudo-types indicate that the actual argument type is either + incompletely specified, or outside the set of ordinary SQL data types. </para> </listitem> </varlistentry> @@ -87,9 +91,13 @@ CREATE [ OR REPLACE ] FUNCTION <replaceable class="parameter">name</replaceable> <listitem> <para> - The return data type. The return type may be specified as a - base, complex, or domain type, or the same as the type of an - existing column. + The return data type (optionally schema-qualified). The return type + may be specified as a base, complex, domain type + or the same as the type of an existing column. See the description + under <literal>argtype</literal> above on how to reference the type + of an existing column. + </para> + <para> Depending on the implementation language it may also be allowed to specify <quote>pseudo-types</> such as <type>cstring</>. The <literal>setof</literal> @@ -432,13 +440,13 @@ CREATE FUNCTION point(complex) RETURNS point <programlisting> Point * complex_to_point (Complex *z) { - Point *p; + Point *p; - p = (Point *) palloc(sizeof(Point)); - p->x = z->x; - p->y = z->y; - - return p; + p = (Point *) palloc(sizeof(Point)); + p->x = z->x; + p->y = z->y; + + return p; } </programlisting> |