diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-06-06 00:41:28 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-06-06 00:41:28 +0000 |
commit | c541bb86e9ec8fed37b23df6a0df703d0bde4dfa (patch) | |
tree | b4cff96eecc86e338274ec5d7355918efe9c149e /doc/src | |
parent | c3a153afed84e29dac664bdc6123724a9e3a906f (diff) | |
download | postgresql-c541bb86e9ec8fed37b23df6a0df703d0bde4dfa.tar.gz postgresql-c541bb86e9ec8fed37b23df6a0df703d0bde4dfa.zip |
Infrastructure for I/O of composite types: arrange for the I/O routines
of a composite type to get that type's OID as their second parameter,
in place of typelem which is useless. The actual changes are mostly
centralized in getTypeInputInfo and siblings, but I had to fix a few
places that were fetching pg_type.typelem for themselves instead of
using the lsyscache.c routines. Also, I renamed all the related variables
from 'typelem' to 'typioparam' to discourage people from assuming that
they necessarily contain array element types.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/create_type.sgml | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml index 348d2673806..b35a1805ca4 100644 --- a/doc/src/sgml/ref/create_type.sgml +++ b/doc/src/sgml/ref/create_type.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.50 2004/05/16 23:22:07 neilc Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.51 2004/06/06 00:41:25 tgl Exp $ PostgreSQL documentation --> @@ -102,13 +102,15 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> ( or as taking three arguments of types <type>cstring</type>, <type>oid</type>, <type>integer</type>. The first argument is the input text as a C string, the second - argument is the element type in case this is an array type, + argument is the element type's OID in case this is an array type + (or the type's own OID for a composite type), and the third is the <literal>typmod</> of the destination column, if known. The input function should return a value of the data type itself. The output function may be declared as taking one argument of the new data type, or as taking two arguments of which the second is type <type>oid</type>. - The second argument is again the array element type for array types. + The second argument is again the array element type OID for array types + or the type OID for composite types. The output function should return type <type>cstring</type>. </para> @@ -128,14 +130,16 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> ( and <type>oid</type>. It must return a value of the data type itself. (The first argument is a pointer to a <type>StringInfo</type> buffer holding the received byte string; the optional second argument is the - element type in case this is an array type.) Similarly, the optional + element type OID in case this is an array type, or the type's own OID for a + composite type.) Similarly, the optional <replaceable class="parameter">send_function</replaceable> converts from the internal representation to the external binary representation. If this function is not supplied, the type cannot participate in binary output. The send function may be declared as taking one argument of the new data type, or as taking two arguments of which the second is type <type>oid</type>. - The second argument is again the array element type for array types. + The second argument is again the array element type OID for array types + or the type OID for composite types. The send function must return type <type>bytea</type>. </para> |