cache lookup failed for type 0

发布时间:2026/7/12 9:25:49

cache lookup failed for type 0 文章目录环境症状问题原因解决方案报错编码环境系统平台银河麒麟 鲲鹏版本4.5.10症状在表中插入数据时报错ERROR: cache lookup failed for type 0。 现象截图问题原因当前未确定问题具体原因。解决方案解决方案先整库逻辑备份依据原表ddl创建新表将数据全部插入新表修改新表名为原表名注意不可使用create table name as select * from table方式此方式不附带default值和索引等只可用于数据备份经与研发沟通后决定采取以上方式处理当前表数据正常但是不确保其他是否存在数据丢失情况。未复现此问题以下是尝试复现了该报错但是与客户现场的现象不否应该不是此问题的根本原因。createtablet2(c1varchar(10),C_TYPEvarchar(20),c3varchar(10),C_TESTvarchar(20),c5varchar(10),C_Tvarchar(20));altertablet2dropCOLUMNC_TEST;highgo# select attrelid,attname,atttypid,attisdropped from pg_attribute where attrelid16387 ;attrelid|attname|atttypid|attisdropped----------------------------------------------------------------16387|seclabel|25|f16387|tableoid|26|f16387|cmax|29|f16387|xmax|28|f16387|cmin|29|f16387|xmin|28|f16387|ctid|27|f16387|c1|1043|f16387|C_TYPE|1043|f16387|c3|1043|f16387|c5|1043|f16387|........pg.dropped.6........|0|t16387|c_t|1043|f--修改此字段系统表pg_attribute的字段attisdroppedfupdatepg_attributesetattisdroppedfwhereattrelid16387andattname........pg.dropped.6........;highgo# select attrelid,attname,atttypid,attisdropped from pg_attribute where attrelid16387 ;attrelid|attname|atttypid|attisdropped----------------------------------------------------------------16387|seclabel|25|f16387|tableoid|26|f16387|cmax|29|f16387|xmax|28|f16387|cmin|29|f16387|xmin|28|f16387|ctid|27|f16387|c1|1043|f16387|C_TYPE|1043|f16387|c3|1043|f16387|c5|1043|f16387|........pg.dropped.6........|0|f16387|c_t|1043|f--执行插入报错highgo# insert into public.t2(c1, C_TYPE, c3, c5) values (1, 1, 1, 1);2025-05-1313:34:00.839CST[14410]ERROR: cache lookup failedfortype02025-05-1313:34:00.839CST[14410]STATEMENT:insertintopublic.t2(c1,C_TYPE,c3,c5)values(1,1,1,1);ERROR: cache lookup failedfortype0与客户环境不一致的是客户环境执行create table t3 as select * from t2; 不会报错本次复现却报错highgo# create table t3 as select * from t2;2025-05-1313:34:34.693CST[14410]ERROR: cache lookup failedfortype02025-05-1313:34:34.693CST[14410]STATEMENT:createtablet3asselect*fromt2;ERROR: cache lookup failedfortype0查找验证客户环境此字段系统表pg_attribute的attisdropped字段为true因此与此次复现不符。-[ RECORD 1 ]------------------------------- attrelid | 224954 attname | ........pg.dropped.95........ atttypid | 0 attstattarget | 0 attlen | -1 attnum | 95 attndims | 0 attcacheoff | -1 atttypmod | 6 attbyval | f attstorage | x attalign | i attnotnull | f atthasdef | f atthasmissing | f attidentity | attgenerated | attisdropped | t attislocal | t attinhcount | 0 attcollation | 100 attacl | attoptions | attfdwoptions | attmissingval |报错编码ERROR: cache lookup failed for type 0

相关新闻