if (!OidIsValid(typoid))
{
address = TypeShellMake(typeName, typeNamespace, GetUserId());
+ typoid = address.objectId;
/* Make new shell type visible for modification below */
CommandCounterIncrement();
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,
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
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)