From c541bb86e9ec8fed37b23df6a0df703d0bde4dfa Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 6 Jun 2004 00:41:28 +0000 Subject: 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. --- doc/src/sgml/ref/create_type.sgml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'doc/src') 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 @@ @@ -102,13 +102,15 @@ CREATE TYPE name ( or as taking three arguments of types cstring, oid, integer. 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 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 oid. - 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 cstring. @@ -128,14 +130,16 @@ CREATE TYPE name ( and oid. It must return a value of the data type itself. (The first argument is a pointer to a StringInfo 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 send_function 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 oid. - 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 bytea. -- cgit v1.2.3