# 升级失败：UniqueViolation：重复键值违反了唯一约束 "data\_explorer\_queries\_pkey"

**URL:** <https://meta.discourse.org/t/failed-upgrade-uniqueviolation-duplicate-key-value-violates-unique-constraint-data-explorer-queries-pkey/163667>\
**Category:** Self-hosting\
**Created:** [2020年九月10日 19:30 UTC](https://meta.discourse.org/t/failed-upgrade-uniqueviolation-duplicate-key-value-violates-unique-constraint-data-explorer-queries-pkey/163667 "2020-09-10T19:30:26Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2020年九月10日 19:57 UTC](https://meta.discourse.org/t/failed-upgrade-uniqueviolation-duplicate-key-value-violates-unique-constraint-data-explorer-queries-pkey/163667/4 "2020-09-10T19:57:49Z")

</div>

那么，重启容器？

`./launcher start app`

然后，你需要执行类似以下的命令：

`./launcher enter app`

接着：

`su postgres -c 'psql discourse'`

---

_[View the full topic](https://meta.discourse.org/t/failed-upgrade-uniqueviolation-duplicate-key-value-violates-unique-constraint-data-explorer-queries-pkey/163667)._
