aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2014-08-25 15:32:26 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2014-08-25 15:32:26 -0400
commit832a12f65e91d4295be73e26079aa8508de0cf32 (patch)
treed31b39f35b603c34f072bf32c619397f74448e8a /src
parent301fcf33eb7fcbcf1da113dabeed90b8eaf656eb (diff)
downloadpostgresql-832a12f65e91d4295be73e26079aa8508de0cf32.tar.gz
postgresql-832a12f65e91d4295be73e26079aa8508de0cf32.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/typecmds.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c
index f377c193719..ec439fabd63 100644
--- a/src/backend/commands/typecmds.c
+++ b/src/backend/commands/typecmds.c
@@ -596,37 +596,37 @@ DefineType(List *names, List *parameters)
/* alignment must be 'i' or 'd' for arrays */
alignment = (alignment == 'd') ? 'd' : 'i';
- typoid = TypeCreate(array_oid, /* force assignment of this type OID */
- array_type, /* type name */
- typeNamespace, /* namespace */
- InvalidOid, /* relation oid (n/a here) */
- 0, /* relation kind (ditto) */
- GetUserId(), /* owner's ID */
- -1, /* internal size (always varlena) */
- TYPTYPE_BASE, /* type-type (base type) */
- TYPCATEGORY_ARRAY, /* type-category (array) */
- false, /* array types are never preferred */
- delimiter, /* array element delimiter */
- F_ARRAY_IN, /* input procedure */
- F_ARRAY_OUT, /* output procedure */
- F_ARRAY_RECV, /* receive procedure */
- F_ARRAY_SEND, /* send procedure */
- typmodinOid, /* typmodin procedure */
- typmodoutOid, /* typmodout procedure */
- F_ARRAY_TYPANALYZE, /* analyze procedure */
- typoid, /* element type ID */
- true, /* yes this is an array type */
- InvalidOid, /* no further array type */
- InvalidOid, /* base type ID */
- NULL, /* never a default type value */
- NULL, /* binary default isn't sent either */
- false, /* never passed by value */
- alignment, /* see above */
- 'x', /* ARRAY is always toastable */
- -1, /* typMod (Domains only) */
- 0, /* Array dimensions of typbasetype */
- false, /* Type NOT NULL */
- collation); /* type's collation */
+ TypeCreate(array_oid, /* force assignment of this type OID */
+ array_type, /* type name */
+ typeNamespace, /* namespace */
+ InvalidOid, /* relation oid (n/a here) */
+ 0, /* relation kind (ditto) */
+ GetUserId(), /* owner's ID */
+ -1, /* internal size (always varlena) */
+ TYPTYPE_BASE, /* type-type (base type) */
+ TYPCATEGORY_ARRAY, /* type-category (array) */
+ false, /* array types are never preferred */
+ delimiter, /* array element delimiter */
+ F_ARRAY_IN, /* input procedure */
+ F_ARRAY_OUT, /* output procedure */
+ F_ARRAY_RECV, /* receive procedure */
+ F_ARRAY_SEND, /* send procedure */
+ typmodinOid, /* typmodin procedure */
+ typmodoutOid, /* typmodout procedure */
+ F_ARRAY_TYPANALYZE, /* analyze procedure */
+ typoid, /* element type ID */
+ true, /* yes this is an array type */
+ InvalidOid, /* no further array type */
+ InvalidOid, /* base type ID */
+ NULL, /* never a default type value */
+ NULL, /* binary default isn't sent either */
+ false, /* never passed by value */
+ alignment, /* see above */
+ 'x', /* ARRAY is always toastable */
+ -1, /* typMod (Domains only) */
+ 0, /* Array dimensions of typbasetype */
+ false, /* Type NOT NULL */
+ collation); /* type's collation */
pfree(array_type);