修复缺陷I6FG7Q:alter table 提示could not find cast from 3904 to 3831

This commit is contained in:
Hemny
2023-03-17 11:53:45 +08:00
parent 9402247a0f
commit 80eb8cd77c
4 changed files with 12 additions and 3 deletions

View File

@ -4187,7 +4187,7 @@ CAUSE: "invalid"
ACTION: "invalid" ACTION: "invalid"
GAUSS-00773: "could not find cast from %u to %u" GAUSS-00773: "could not find cast from %s to %s"
SQLSTATE: XX000 SQLSTATE: XX000
CAUSE: "invalid" CAUSE: "invalid"
ACTION: "invalid" ACTION: "invalid"

View File

@ -14812,7 +14812,7 @@ static CoercionPathType findFkeyCast(Oid targetTypeId, Oid sourceTypeId, Oid* fu
/* A previously-relied-upon cast is now gone. */ /* A previously-relied-upon cast is now gone. */
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_CHARACTER_VALUE_FOR_CAST), (errcode(ERRCODE_INVALID_CHARACTER_VALUE_FOR_CAST),
errmsg("could not find cast from %u to %u", sourceTypeId, targetTypeId))); errmsg("could not find cast from %s to %s", format_type_be(sourceTypeId), format_type_be(targetTypeId))));
} }
return ret; return ret;

View File

@ -2863,3 +2863,8 @@ Options: orientation=row, compression=no
drop table test_unique; drop table test_unique;
\c postgres \c postgres
create table t_alter_type(c0 int4range Unique, foreign key(c0) references t_alter_type(c0));
NOTICE: CREATE TABLE / UNIQUE will create implicit index "t_alter_type_c0_key" for table "t_alter_type"
alter table t_alter_type alter c0 set data type int4range;
ERROR: could not find cast from int4range to anyrange
drop table t_alter_type;

View File

@ -1376,4 +1376,8 @@ alter table test_unique add unique using btree(f31) comment 'unique index' using
\d+ test_unique \d+ test_unique
drop table test_unique; drop table test_unique;
\c postgres \c postgres
create table t_alter_type(c0 int4range Unique, foreign key(c0) references t_alter_type(c0));
alter table t_alter_type alter c0 set data type int4range;
drop table t_alter_type;