同步表时出现了一个错误:"Unknown colType: regclass" #1377

Closed
opened 2019-07-31 04:05:41 +00:00 by githubyb · 4 comments
githubyb commented 2019-07-31 04:05:41 +00:00 (Migrated from github.com)

之前一直都是没有问题的,在使用了pathman这个pg插件后engine.Sync2()这个方法会报一个"Unknown colType: regclass"的错误,看了一下pathman这个插件会在我们的数据库下创建好几张表,其中有一张表的列类型是"regclass",按道理这个表不是我要同步的表,不应该报错才对

之前一直都是没有问题的,在使用了pathman这个pg插件后engine.Sync2()这个方法会报一个"Unknown colType: regclass"的错误,看了一下pathman这个插件会在我们的数据库下创建好几张表,其中有一张表的列类型是"regclass",按道理这个表不是我要同步的表,不应该报错才对
githubyb commented 2019-07-31 07:25:56 +00:00 (Migrated from github.com)

追踪发现是dialect_postgres.go文件的1041行报的错,此时col.SQLType.Name是"REGCLASS"
然而core.SqlTypes这个map里是没有这个键的,因此就报错了,直接return
这个要怎么改呢?
if _, ok := core.SqlTypes[col.SQLType.Name]; !ok { return nil, nil, fmt.Errorf("Unknown colType: %v", dataType) }

追踪发现是dialect_postgres.go文件的1041行报的错,此时col.SQLType.Name是"REGCLASS" 然而core.SqlTypes这个map里是没有这个键的,因此就报错了,直接return 这个要怎么改呢? `if _, ok := core.SqlTypes[col.SQLType.Name]; !ok { return nil, nil, fmt.Errorf("Unknown colType: %v", dataType) }`

I think we should support user-define column types.

I think we should support user-define column types.
githubyb commented 2019-07-31 07:50:59 +00:00 (Migrated from github.com)

Thank you for your attention
I found someone saying that regclass is an alias for oid datatype,but I don't know what this means.

Thank you for your attention I found someone saying that regclass is an alias for oid datatype,but I don't know what this means.
smilucky commented 2019-09-03 01:38:41 +00:00 (Migrated from github.com)

遇到同样的问题,急需解决,为了避免这个错误去掉同步后遇到了更大的升级失败问题。有解决deadline吗?

遇到同样的问题,急需解决,为了避免这个错误去掉同步后遇到了更大的升级失败问题。有解决deadline吗?
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#1377
No description provided.