index 907ba1100ace7316f5fb7930be754736ba6b8b5c..7d8561022a52f3d2db87f6110bc020ff0117bbf4 100644 (file)
@@ -215,6 +215,7 @@ DefineType(List *names, List *parameters)
if (!OidIsValid(typoid))
{
address = TypeShellMake(typeName, typeNamespace, GetUserId());
+ typoid = address.objectId;
/* Make new shell type visible for modification below */
CommandCounterIncrement();
@@ -628,6 +629,7 @@ DefineType(List *names, List *parameters)
0, /* Array Dimensions of typbasetype */
false, /* Type NOT NULL */
collation); /* type's collation */
+ Assert(typoid == address.objectId);
/*
* Create the array type that goes with it.
0, /* Array dimensions of typbasetype */
false, /* Type NOT NULL */
InvalidOid); /* type's collation (ranges never have one) */
- typoid = address.objectId;
+ Assert(typoid == address.objectId);
/* Create the entry in pg_range */
RangeCreate(typoid, rangeSubtype, rangeCollation, rangeSubOpclass,
index 35e8f5d6a25dba64ab4864f3e27259de0bce0037..b5af862ce5c14425f8e4b61c1aa07067966a51c4 100644 (file)
DROP TYPE default_test_row CASCADE;
NOTICE: drop cascades to function get_default_test()
DROP TABLE default_test;
+-- Check type create with input/output incompatibility
+CREATE TYPE not_existing_type (INPUT = array_in,
+ OUTPUT = array_out,
+ ELEMENT = int,
+ INTERNALLENGTH = 32);
+ERROR: function array_out(not_existing_type) does not exist
-- Check usage of typmod with a user-defined type
-- (we have borrowed numeric's typmod functions)
CREATE TEMP TABLE mytab (foo widget(42,13,7)); -- should fail
index 96a075b0267882bb9b540ab5656e945f3cf6e966..29ba625b46ad1c4654562365106743d3fcd6a022 100644 (file)
DROP TABLE default_test;
+-- Check type create with input/output incompatibility
+CREATE TYPE not_existing_type (INPUT = array_in,
+ OUTPUT = array_out,
+ ELEMENT = int,
+ INTERNALLENGTH = 32);
+
-- Check usage of typmod with a user-defined type
-- (we have borrowed numeric's typmod functions)