aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-07-10 21:14:00 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-07-10 21:14:00 +0000
commitd78397d301172cccce14d5d789f296c47dd47c5e (patch)
tree4104dc887976aee14286c0c0a7be03f84af43b7d /doc/src
parent2e330699fae72c40f5237ce0f4fc210c483d2816 (diff)
downloadpostgresql-d78397d301172cccce14d5d789f296c47dd47c5e.tar.gz
postgresql-d78397d301172cccce14d5d789f296c47dd47c5e.zip
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.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/create_type.sgml15
1 files changed, 8 insertions, 7 deletions
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 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.55 2005/05/01 18:56:17 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.56 2005/07/10 21:13:57 tgl Exp $
PostgreSQL documentation
-->
@@ -125,12 +125,13 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> (
function should perform adequate checking to ensure that the value is
valid.
The receive function may be declared as taking one argument of type
- <type>internal</type>, or two arguments of types <type>internal</type>
- 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 OID in case this is an array type, or the type's own OID for a
- composite type.) Similarly, the optional
+ <type>internal</type>, or as taking three arguments of types
+ <type>internal</type>, <type>oid</type>, <type>integer</type>.
+ The first argument is a pointer to a <type>StringInfo</type> 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
<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