# "EXCEPTION: psql failed: DETAIL: Key (post\_id)=(36946) is duplicated."

**URL:** <https://meta.discourse.org/t/exception-psql-failed-detail-key-post-id-36946-is-duplicated/230356>\
**Category:** Self-hosting\
**Created:** [June 18, 2022, 5:24am UTC](https://meta.discourse.org/t/exception-psql-failed-detail-key-post-id-36946-is-duplicated/230356 "2022-06-18T05:24:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![MiG](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mig/32/119486_2.png) [@MiG](https://meta.discourse.org/u/MiG)\
**Post date:** [June 19, 2022, 4:11am UTC](https://meta.discourse.org/t/exception-psql-failed-detail-key-post-id-36946-is-duplicated/230356/3 "2022-06-19T04:11:08Z")

</div>

Yes, I think it’s corrupt. Would love it if someone could tell me how to fix it 🙂

Postgres is 13.6. I’m trying to move it to a new instance on a different server.

I tried `rake search:reindex` inside the docker container, and it fails with:

```plaintext
........rake aborted!
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "posts_search_pkey"
DETAIL: Key (post_id)=(86919) already exists.

```

Is it possible to just drop the offending record and re-index or something?

Any help appreciated!

---

_[View the full topic](https://meta.discourse.org/t/exception-psql-failed-detail-key-post-id-36946-is-duplicated/230356)._
