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

Commit832a12f

Browse files
committed
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 isjust a subsidiary object which is not of much interest.
1 parent301fcf3 commit832a12f

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

‎src/backend/commands/typecmds.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -596,37 +596,37 @@ DefineType(List *names, List *parameters)
596596
/* alignment must be 'i' or 'd' for arrays */
597597
alignment= (alignment=='d') ?'d' :'i';
598598

599-
typoid=TypeCreate(array_oid,/* force assignment of this type OID */
600-
array_type,/* type name */
601-
typeNamespace,/* namespace */
602-
InvalidOid,/* relation oid (n/a here) */
603-
0,/* relation kind (ditto) */
604-
GetUserId(),/* owner's ID */
605-
-1,/* internal size (always varlena) */
606-
TYPTYPE_BASE,/* type-type (base type) */
607-
TYPCATEGORY_ARRAY,/* type-category (array) */
608-
false,/* array types are never preferred */
609-
delimiter,/* array element delimiter */
610-
F_ARRAY_IN,/* input procedure */
611-
F_ARRAY_OUT,/* output procedure */
612-
F_ARRAY_RECV,/* receive procedure */
613-
F_ARRAY_SEND,/* send procedure */
614-
typmodinOid,/* typmodin procedure */
615-
typmodoutOid,/* typmodout procedure */
616-
F_ARRAY_TYPANALYZE,/* analyze procedure */
617-
typoid,/* element type ID */
618-
true,/* yes this is an array type */
619-
InvalidOid,/* no further array type */
620-
InvalidOid,/* base type ID */
621-
NULL,/* never a default type value */
622-
NULL,/* binary default isn't sent either */
623-
false,/* never passed by value */
624-
alignment,/* see above */
625-
'x',/* ARRAY is always toastable */
626-
-1,/* typMod (Domains only) */
627-
0,/* Array dimensions of typbasetype */
628-
false,/* Type NOT NULL */
629-
collation);/* type's collation */
599+
TypeCreate(array_oid,/* force assignment of this type OID */
600+
array_type,/* type name */
601+
typeNamespace,/* namespace */
602+
InvalidOid,/* relation oid (n/a here) */
603+
0,/* relation kind (ditto) */
604+
GetUserId(),/* owner's ID */
605+
-1,/* internal size (always varlena) */
606+
TYPTYPE_BASE,/* type-type (base type) */
607+
TYPCATEGORY_ARRAY,/* type-category (array) */
608+
false,/* array types are never preferred */
609+
delimiter,/* array element delimiter */
610+
F_ARRAY_IN,/* input procedure */
611+
F_ARRAY_OUT,/* output procedure */
612+
F_ARRAY_RECV,/* receive procedure */
613+
F_ARRAY_SEND,/* send procedure */
614+
typmodinOid,/* typmodin procedure */
615+
typmodoutOid,/* typmodout procedure */
616+
F_ARRAY_TYPANALYZE,/* analyze procedure */
617+
typoid,/* element type ID */
618+
true,/* yes this is an array type */
619+
InvalidOid,/* no further array type */
620+
InvalidOid,/* base type ID */
621+
NULL,/* never a default type value */
622+
NULL,/* binary default isn't sent either */
623+
false,/* never passed by value */
624+
alignment,/* see above */
625+
'x',/* ARRAY is always toastable */
626+
-1,/* typMod (Domains only) */
627+
0,/* Array dimensions of typbasetype */
628+
false,/* Type NOT NULL */
629+
collation);/* type's collation */
630630

631631
pfree(array_type);
632632

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp