Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

唯一约束索引条件下存在重复的数据 #125

Open
darkframemaster opened this issue May 31, 2024 · 2 comments
Open

唯一约束索引条件下存在重复的数据 #125

darkframemaster opened this issue May 31, 2024 · 2 comments

Comments

@darkframemaster
Copy link

数据库的server是 15.6 版本的(下图一),最近使用 pg_upgrade 从 9.4 升级到了 15.6,现在是一个表有唯一索引,但是还是存在了相同的记录(下图二),这个记录的 update_time 字段来看是在升级之后插入的,请问有些什么排查和解决方法呢?谢谢

image

image

@digoal
Copy link
Owner

digoal commented Jun 2, 2024

可能9.4版本就已经存在这个问题, 只不过是在升级后触发了. 可能是比较难触发的bug, 我在8.4的版本也遇到过. 不太好排查, 你担心的话可以使用SQL, 关闭索引扫描, 看一看count distinct PK有没有异常记录, 先人为处理一下数据, 重建唯一索引

@yangjuncode
Copy link

可以参巧一下这个https://www.v2ex.com/t/921641#reply5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants