File tree 2 files changed +10
-9
lines changed
2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 1
1
<!--
2
- $PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.57 2005/07/14 06:17:36 neilc Exp $
2
+ $PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.58 2005/08/12 21:49:46 tgl Exp $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -103,8 +103,8 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> (
103
103
or as taking three arguments of types
104
104
<type>cstring</type>, <type>oid</type>, <type>integer</type>.
105
105
The first argument is the input text as a C string, the second
106
- argument is the element type's OID in case this is an array type
107
- (or the type's own OID for a composite type ),
106
+ argument is the type's own OID (except for array types, which instead
107
+ receive their element type's OID),
108
108
and the third is the <literal>typmod</> of the destination column, if known
109
109
(-1 will be passed if not).
110
110
The input function must return a value of the data type itself.
Original file line number Diff line number Diff line change 7
7
* Portions Copyright (c) 1994, Regents of the University of California
8
8
*
9
9
* IDENTIFICATION
10
- * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.126 2005/06/28 05:09:01 tgl Exp $
10
+ * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.127 2005/08/12 21:49:47 tgl Exp $
11
11
*
12
12
* NOTES
13
13
* Eventually, the index information should go through here, too.
@@ -1223,13 +1223,14 @@ getTypeIOParam(HeapTuple typeTuple)
1223
1223
Form_pg_type typeStruct = (Form_pg_type ) GETSTRUCT (typeTuple );
1224
1224
1225
1225
/*
1226
- * Composite types get their own OID as parameter; array types get
1227
- * their typelem as parameter; everybody else gets zero.
1226
+ * Array types get their typelem as parameter; everybody else gets
1227
+ * their own type OID as parameter. (This is a change from 8.0,
1228
+ * in which only composite types got their own OID as parameter.)
1228
1229
*/
1229
- if (typeStruct -> typtype == 'c' )
1230
- return HeapTupleGetOid (typeTuple );
1231
- else
1230
+ if (OidIsValid (typeStruct -> typelem ))
1232
1231
return typeStruct -> typelem ;
1232
+ else
1233
+ return HeapTupleGetOid (typeTuple );
1233
1234
}
1234
1235
1235
1236
/*
You can’t perform that action at this time.
0 commit comments