# Upgrade probleem met dubbele gebruikersnaam in DB

**URL:** <https://meta.discourse.org/t/upgrade-issue-with-duplicate-username-in-db/177664>\
**Category:** Self-hosting\
**Created:** [29 januari 2021 om 12:30 UTC](https://meta.discourse.org/t/upgrade-issue-with-duplicate-username-in-db/177664 "2021-01-29T12:30:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![volksman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/volksman/32/207678_2.png) [@volksman](https://meta.discourse.org/u/volksman)\
**Post date:** [29 januari 2021 om 13:00 UTC](https://meta.discourse.org/t/upgrade-issue-with-duplicate-username-in-db/177664/2 "2021-01-29T13:00:00Z")

</div>

Well here’s how I solved it but I’m sure there is a better way:

I went to my admin section and searched for ‘MikeC’ which returned 2 users. So I renamed the oldest one and instead of running rebuild again I simply logged into the DB and reindexed:

```
cd /var/discourse
./launcher enter app
sudo -i postgres psql discourse
discourse# REINDEX SCHEMA CONCURRENTLY public;

```

That would indicate another dupe and I would return to the WebUI and search for that user and rename the older user. Wash, rinse, repeat until no dupes found. Then rebuild and success!

I would however like to know:

1. Why does discourse allow dupes? Username can be case insensitive but username\_lower normalizes to what should be a unique value. This seems like a pretty big bug.

2. What is a better way to find and fix these dupes?

---

_[View the full topic](https://meta.discourse.org/t/upgrade-issue-with-duplicate-username-in-db/177664)._
