1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-23 14:01:44 +03:00

Change CREATE TYPE to require datatype output and send functions to have

only one argument.  (Per recent discussion, the option to accept multiple
arguments is pretty useless for user-defined types, and would be a likely
source of security holes if it was used.)  Simplify call sites of
output/send functions to not bother passing more than one argument.
This commit is contained in:
Tom Lane
2005-05-01 18:56:19 +00:00
parent ae793ff63c
commit 6c412f0605
18 changed files with 102 additions and 216 deletions

View File

@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.54 2005/01/04 00:39:53 tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.55 2005/05/01 18:56:17 tgl Exp $
PostgreSQL documentation
-->
@ -107,13 +107,10 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> (
(or the type's own OID for a composite type),
and the third is the <literal>typmod</> of the destination column, if known
(-1 will be passed if not).
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 OID for array types
or the type OID for composite types.
The output function should return type <type>cstring</type>.
The input function must return a value of the data type itself.
The output function must be
declared as taking one argument of the new data type.
The output function must return type <type>cstring</type>.
</para>
<para>
@ -137,11 +134,8 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> (
<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 OID for array types
or the type OID for composite types.
output. The send function must be
declared as taking one argument of the new data type.
The send function must return type <type>bytea</type>.
</para>