Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit59c016a

Browse files
committed
Pass the type OID as the typioparam for all non-array types, rather than
only composite types as we did in 8.0. Per discussion with Martijnvan Oosterhout.
1 parentbb2ffe9 commit59c016a

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

‎doc/src/sgml/ref/create_type.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
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 $
33
PostgreSQL documentation
44
-->
55

@@ -103,8 +103,8 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> (
103103
or as taking three arguments of types
104104
<type>cstring</type>, <type>oid</type>, <type>integer</type>.
105105
The first argument is the input text as a C string, the second
106-
argument is theelementtype's OIDin case this is an array type
107-
(or thetype'sownOID for a composite type),
106+
argument is the type'sownOID(except for array types, which instead
107+
receive their elementtype's OID),
108108
and the third is the <literal>typmod</> of the destination column, if known
109109
(-1 will be passed if not).
110110
The input function must return a value of the data type itself.

‎src/backend/utils/cache/lsyscache.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* 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 $
1111
*
1212
* NOTES
1313
* Eventually, the index information should go through here, too.
@@ -1223,13 +1223,14 @@ getTypeIOParam(HeapTuple typeTuple)
12231223
Form_pg_typetypeStruct= (Form_pg_type)GETSTRUCT(typeTuple);
12241224

12251225
/*
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.)
12281229
*/
1229-
if (typeStruct->typtype=='c')
1230-
returnHeapTupleGetOid(typeTuple);
1231-
else
1230+
if (OidIsValid(typeStruct->typelem))
12321231
returntypeStruct->typelem;
1232+
else
1233+
returnHeapTupleGetOid(typeTuple);
12331234
}
12341235

12351236
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp