# PG16.3 손상된 인덱스 수정 (백업에서 복원 불가 - 고유 인덱스 생성 실패)

**URL:** <https://meta.discourse.org/t/fixing-a-corrupted-index-pg16-3-unable-to-restore-from-backup-could-not-create-unique-index/326261>\
**Category:** Product Support\
**Created:** [9월 12, 2024, 7:41오후 UTC](https://meta.discourse.org/t/fixing-a-corrupted-index-pg16-3-unable-to-restore-from-backup-could-not-create-unique-index/326261 "2024-09-12T19:41:34Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)\
**Post date:** [9월 12, 2024, 7:41오후 UTC](https://meta.discourse.org/t/fixing-a-corrupted-index-pg16-3-unable-to-restore-from-backup-could-not-create-unique-index/326261/1 "2024-09-12T19:41:34Z")

</div>

Discourse를 새 서버로 이전하려고 했는데 백업 복원 과정에서 문제가 발생했습니다:

```plaintext
[2024-09-12 06:57:25] ERROR: could not create unique index "unique_post_links"
[2024-09-12 06:57:25] DETAIL: Key (topic_id, post_id, url)=(2026, 4639, http://www.metronet.com/~mob) is duplicated.
[2024-09-12 06:57:27] EXCEPTION: psql failed: DETAIL: Key (topic_id, post_id, url)=(2026, 4639, http://www.metronet.com/~mob) is duplicated.

```

손상된 인덱스를 수정하는 방법에 대한 주제가 많이 있지만 대부분 오래되었습니다. 16과 같은 더 새로운 PG 버전에서 **중복 항목을 찾는** 방법과 **수정** 하는 방법에 대한 확실한 가이드가 있을까요? 파일이 포함된 백업은 37GB, 파일이 없는 백업은 5GB입니다.

이전/복원 작업에 시간이 오래 걸리기 때문에, 새로운 이전/복원을 시도하기 전에 위에서 언급한 것 외에 더 많은 중복 항목이 있는지 확인하고 싶습니다.

---

_[View the full topic](https://meta.discourse.org/t/fixing-a-corrupted-index-pg16-3-unable-to-restore-from-backup-could-not-create-unique-index/326261)._
