diff options
Diffstat (limited to 'doc/src/sgml/extend.sgml')
| -rw-r--r-- | doc/src/sgml/extend.sgml | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index ad22a5dcdd..bb5834e74a 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/extend.sgml,v 1.33 2007/01/31 20:56:17 momjian Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/extend.sgml,v 1.34 2007/04/02 03:49:36 tgl Exp $ --> <chapter id="extend"> <title>Extending <acronym>SQL</acronym></title> @@ -193,9 +193,10 @@ </indexterm> <para> - Two pseudo-types of special interest are <type>anyelement</> and - <type>anyarray</>, which are collectively called <firstterm>polymorphic - types</>. Any function declared using these types is said to be + Three pseudo-types of special interest are <type>anyelement</>, + <type>anyarray</>, and <type>anyenum</>, + which are collectively called <firstterm>polymorphic types</>. + Any function declared using these types is said to be a <firstterm>polymorphic function</>. A polymorphic function can operate on many different data types, with the specific data type(s) being determined by the data types actually passed to it in a particular @@ -215,6 +216,9 @@ <type>anyelement</type>, the actual array type in the <type>anyarray</type> positions must be an array whose elements are the same type appearing in the <type>anyelement</type> positions. + <type>anyenum</> is treated exactly the same as <type>anyelement</>, + but adds the additional constraint that the actual type must + be an enum type. </para> <para> @@ -234,7 +238,9 @@ implements subscripting as <literal>subscript(anyarray, integer) returns anyelement</>. This declaration constrains the actual first argument to be an array type, and allows the parser to infer the correct - result type from the actual first argument's type. + result type from the actual first argument's type. Another example + is that a function declared as <literal>f(anyarray) returns anyenum</> + will only accept arrays of enum types. </para> </sect2> </sect1> |
