Commit 832a12f6 authored by Alvaro Herrera's avatar Alvaro Herrera

DefineType: return base type OID, not its array

Event triggers want to know the OID of the interesting object created,
which is the main type.  The array created as part of the operation is
just a subsidiary object which is not of much interest.
parent 301fcf33
...@@ -596,37 +596,37 @@ DefineType(List *names, List *parameters) ...@@ -596,37 +596,37 @@ DefineType(List *names, List *parameters)
/* alignment must be 'i' or 'd' for arrays */ /* alignment must be 'i' or 'd' for arrays */
alignment = (alignment == 'd') ? 'd' : 'i'; alignment = (alignment == 'd') ? 'd' : 'i';
typoid = TypeCreate(array_oid, /* force assignment of this type OID */ TypeCreate(array_oid, /* force assignment of this type OID */
array_type, /* type name */ array_type, /* type name */
typeNamespace, /* namespace */ typeNamespace, /* namespace */
InvalidOid, /* relation oid (n/a here) */ InvalidOid, /* relation oid (n/a here) */
0, /* relation kind (ditto) */ 0, /* relation kind (ditto) */
GetUserId(), /* owner's ID */ GetUserId(), /* owner's ID */
-1, /* internal size (always varlena) */ -1, /* internal size (always varlena) */
TYPTYPE_BASE, /* type-type (base type) */ TYPTYPE_BASE, /* type-type (base type) */
TYPCATEGORY_ARRAY, /* type-category (array) */ TYPCATEGORY_ARRAY, /* type-category (array) */
false, /* array types are never preferred */ false, /* array types are never preferred */
delimiter, /* array element delimiter */ delimiter, /* array element delimiter */
F_ARRAY_IN, /* input procedure */ F_ARRAY_IN, /* input procedure */
F_ARRAY_OUT, /* output procedure */ F_ARRAY_OUT, /* output procedure */
F_ARRAY_RECV, /* receive procedure */ F_ARRAY_RECV, /* receive procedure */
F_ARRAY_SEND, /* send procedure */ F_ARRAY_SEND, /* send procedure */
typmodinOid, /* typmodin procedure */ typmodinOid, /* typmodin procedure */
typmodoutOid, /* typmodout procedure */ typmodoutOid, /* typmodout procedure */
F_ARRAY_TYPANALYZE, /* analyze procedure */ F_ARRAY_TYPANALYZE, /* analyze procedure */
typoid, /* element type ID */ typoid, /* element type ID */
true, /* yes this is an array type */ true, /* yes this is an array type */
InvalidOid, /* no further array type */ InvalidOid, /* no further array type */
InvalidOid, /* base type ID */ InvalidOid, /* base type ID */
NULL, /* never a default type value */ NULL, /* never a default type value */
NULL, /* binary default isn't sent either */ NULL, /* binary default isn't sent either */
false, /* never passed by value */ false, /* never passed by value */
alignment, /* see above */ alignment, /* see above */
'x', /* ARRAY is always toastable */ 'x', /* ARRAY is always toastable */
-1, /* typMod (Domains only) */ -1, /* typMod (Domains only) */
0, /* Array dimensions of typbasetype */ 0, /* Array dimensions of typbasetype */
false, /* Type NOT NULL */ false, /* Type NOT NULL */
collation); /* type's collation */ collation); /* type's collation */
pfree(array_type); pfree(array_type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment