# 고유 제약 조건을 위반하는 중복 키 값 오류로 업그레이드 실패

**URL:** https://meta.discourse.org/t/upgrade-failed-with-duplicate-key-value-violates-unique-constraint-error/142767
**Category:** Self-hosting
**Created:** [2월 27, 2020, 10:54오전 UTC](https://meta.discourse.org/t/upgrade-failed-with-duplicate-key-value-violates-unique-constraint-error/142767 "2020-02-27T10:54:22Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![morevnaproject](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/morevnaproject/32/171168_2.png) [@morevnaproject](https://meta.discourse.org/u/morevnaproject)
#### Post date: [2월 27, 2020, 1:47오후 UTC](https://meta.discourse.org/t/upgrade-failed-with-duplicate-key-value-violates-unique-constraint-error/142767/5 "2020-02-27T13:47:51Z")

</div>

음, postgresql 서비스를 시작하는 데 성공했고, [데이터베이스 백업](https://meta.discourse.org/t/advanced-manual-method-of-manually-creating-and-restoring-discourse-backups/18273)을 수행한 후 데이터베이스에 접속했습니다:

```plaintext
# chown -R postgres /shared/postgres_data
# service postgresql start
 * Starting PostgreSQL 10 database server [OK] 
# psql
psql: FATAL: role "root" does not exist
# su - discourse
$ pg_dump -xOf ~/discourse-backup.sql -d discourse -n public
$ exit
# mv /home/discourse/discourse-backup.sql /shared/discourse-backup-20200227-1.sql
# su - postgres
$ psql discourse
psql (10.4 (Ubuntu 10.4-2.pgdg16.04+1))
Type "help" for help.

discourse=#

```

이제 제 설치를 복구하려면 어떻게 해야 할까요?

---

_[View the full topic](https://meta.discourse.org/t/upgrade-failed-with-duplicate-key-value-violates-unique-constraint-error/142767)._
