Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d1d720

Browse files
committed
Minor doc patch: create function
Gavin Sherry
1 parentee30373 commit7d1d720

File tree

1 file changed

+30
-22
lines changed

1 file changed

+30
-22
lines changed

‎doc/src/sgml/ref/create_function.sgml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.44 2003/01/19 00:13:29 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.45 2003/03/20 04:41:13 momjian Exp $
33
-->
44

55
<refentry id="SQL-CREATEFUNCTION">
@@ -66,18 +66,22 @@ CREATE [ OR REPLACE ] FUNCTION <replaceable class="parameter">name</replaceable>
6666

6767
<listitem>
6868
<para>
69-
The data type(s) of the function's arguments, if any. The
70-
input types may be base, complex, or domain types,
71-
or the same as the type of an existing column.
72-
The type of a column is referenced by writing <replaceable
73-
class="parameter">tablename</replaceable>.<replaceable
74-
class="parameter">columnname</replaceable><literal>%TYPE</literal>;
75-
using this can sometimes help make a function independent from
76-
changes to the definition of a table.
77-
Depending on the implementation language it may also be allowed
78-
to specify <quote>pseudo-types</> such as <type>cstring</>.
79-
Pseudo-types indicate that the actual argument type is either
80-
incompletely specified, or outside the set of ordinary SQL data types.
69+
The data type(s) of the function's arguments (optionally
70+
schema-qualified), if any. The input types may be base, complex, or
71+
domain types, or the same as the type of an existing column.
72+
</para>
73+
<para>
74+
The type of a column is referenced by writing <replaceable
75+
class="parameter">tablename</replaceable>.<replaceable
76+
class="parameter">columnname</replaceable><literal>%TYPE</literal>;
77+
using this can sometimes help make a function independent from
78+
changes to the definition of a table.
79+
</para>
80+
<para>
81+
Depending on the implementation language it may also be allowed
82+
to specify <quote>pseudo-types</> such as <type>cstring</>.
83+
Pseudo-types indicate that the actual argument type is either
84+
incompletely specified, or outside the set of ordinary SQL data types.
8185
</para>
8286
</listitem>
8387
</varlistentry>
@@ -87,9 +91,13 @@ CREATE [ OR REPLACE ] FUNCTION <replaceable class="parameter">name</replaceable>
8791

8892
<listitem>
8993
<para>
90-
The return data type. The return type may be specified as a
91-
base, complex, or domain type, or the same as the type of an
92-
existing column.
94+
The return data type (optionally schema-qualified). The return type
95+
may be specified as a base, complex, domain type
96+
or the same as the type of an existing column. See the description
97+
under <literal>argtype</literal> above on how to reference the type
98+
of an existing column.
99+
</para>
100+
<para>
93101
Depending on the implementation language it may also be allowed
94102
to specify <quote>pseudo-types</> such as <type>cstring</>.
95103
The <literal>setof</literal>
@@ -432,13 +440,13 @@ CREATE FUNCTION point(complex) RETURNS point
432440
<programlisting>
433441
Point * complex_to_point (Complex *z)
434442
{
435-
Point *p;
443+
Point *p;
436444

437-
p = (Point *) palloc(sizeof(Point));
438-
p->x = z->x;
439-
p->y = z->y;
440-
441-
return p;
445+
p = (Point *) palloc(sizeof(Point));
446+
p->x = z->x;
447+
p->y = z->y;
448+
449+
return p;
442450
}
443451
</programlisting>
444452

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp