From d78397d301172cccce14d5d789f296c47dd47c5e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 10 Jul 2005 21:14:00 +0000 Subject: Change typreceive function API so that receive functions get the same optional arguments as text input functions, ie, typioparam OID and atttypmod. Make all the datatypes that use typmod enforce it the same way in typreceive as they do in typinput. This fixes a problem with failure to enforce length restrictions during COPY FROM BINARY. --- doc/src/sgml/ref/create_type.sgml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml index 69899d84f53..4f002b65194 100644 --- a/doc/src/sgml/ref/create_type.sgml +++ b/doc/src/sgml/ref/create_type.sgml @@ -1,5 +1,5 @@ @@ -125,12 +125,13 @@ CREATE TYPE name ( function should perform adequate checking to ensure that the value is valid. The receive function may be declared as taking one argument of type - internal, or two arguments of types internal - 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 OID in case this is an array type, or the type's own OID for a - composite type.) Similarly, the optional + internal, or as taking three arguments of types + internal, oid, integer. + The first argument is a pointer to a StringInfo buffer + holding the received byte string; the optional arguments are the + same as for the text input function. + The receive function must return a value of the data type itself. + 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 -- cgit v1.2.3