当前位置:网站首页>[170] the PostgreSQL 10 field type is changed from string to integer, and the error column cannot be cast automatically to type integer is reported
[170] the PostgreSQL 10 field type is changed from string to integer, and the error column cannot be cast automatically to type integer is reported
2022-06-27 15:29:00 【zhangchao19890805】
Error recurrence
The original field type is character varying Change to integer
ALTER TABLE table_name ALTER COLUMN column_name TYPE integer
PostgreSQL 10 Report errors :
ERROR: column "column_name" cannot be cast automatically to type integer
HINT: You might need to specify "USING column_name::integer".
SQL state: 42804
resolvent
Make sure there is no string data in the field to be modified , If any, it needs to be set to NULL.
Change the statement of modifying the field to the following :
ALTER TABLE table_name ALTER COLUMN column_name TYPE integer using column_name::integer;
Note that there must be using column_name::integer Otherwise, an error will be reported .
边栏推荐
- 创建数据库并使用
- 专用发票和普通发票的区别
- FPGA based analog I ² C protocol system design (with main code)
- Massive data! Second level analysis! Flink+doris build a real-time data warehouse scheme
- 洛谷入门1【顺序结构】题单题解
- PSS:你距离NMS-free+提点只有两个卷积层 | 2021论文
- PSS: vous n'êtes qu'à deux niveaux du NMS Free + Lifting point | 2021 Paper
- Nvidia Deepstream 运行延迟,卡顿,死机处理办法
- Redis CacheClient
- Interpretation of new version features of PostgreSQL 15 (including live Q & A and PPT data summary)
猜你喜欢

VS编译遇到的问题

Use GCC to generate an abstract syntax tree "ast" and dump it to Dot file and visualization

反射学习总结

How is the London Silver point difference calculated

volatile与JMM

Hyperledger Fabric 2. X custom smart contract

Teach you how to package and release the mofish Library

SQL parsing practice of Pisa proxy

CV领域一代宗师黄煦涛教授86岁冥诞,UIUC专设博士奖学金激励新锐

Derivation of Halcon camera calibration principle
随机推荐
Cannot determine value type from string ‘<p>1</p>‘
关于 Spartacus 的 sitemap.xml 问题
[WUSTCTF2020]girlfriend
volatile与JMM
How to change a matrix into a triple in R language (i.e. three columns: row, col, value)
優雅的自定義 ThreadPoolExecutor 線程池
CV领域一代宗师黄煦涛教授86岁冥诞,UIUC专设博士奖学金激励新锐
VS编译遇到的问题
专用发票和普通发票的区别
2022-2-15 learning the imitated Niuke project - Section 5 shows comments
What are the characteristics of fixed income + products?
专家:让你低分上好校的都是诈骗
Computer screen splitting method
ReentrantLock、ReentrantReadWriteLock、StampedLock
Jupiter core error
Why can't the start method be called repeatedly? But the run method can?
#27ES6的数值扩展
【kotlin】第二天
AutoCAD - line width setting
[issue 18] share a Netease go classic