# Restoring from backup failing: failure creating postgres index

**URL:** https://meta.discourse.org/t/restoring-from-backup-failing-failure-creating-postgres-index/153014
**Category:** Self-hosting
**Created:** [May 27, 2020, 7:59pm UTC](https://meta.discourse.org/t/restoring-from-backup-failing-failure-creating-postgres-index/153014 "2020-05-27T19:59:18Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![Dustin\_Lang](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dustin_lang/32/182052_2.png) [@Dustin\_Lang](https://meta.discourse.org/u/Dustin_Lang)
#### Post date: [May 28, 2020, 12:47am UTC](https://meta.discourse.org/t/restoring-from-backup-failing-failure-creating-postgres-index/153014/5 "2020-05-28T00:47:57Z")

</div>

Wow, it would be _really_ nice if the upgrade process could remedy some of these issues!

So after installing the [data explorer](https://meta.discourse.org/t/32566?silent=true) plugin and poking around in the incoming\_referers index, and dropping other indices listed by the query here:

> [@Corrupt indexes in PG12, how do I fix?](https://meta.discourse.org/t/corrupt-indexes-in-pg12-how-do-i-fix/152570/35):
>
> If a concurrent REINDEX fails because the table has invalid data, you need to: Fix the invalid data, like it was done [here](https://meta.discourse.org/t/corrupt-indexes-in-pg12-how-do-i-fix/152570/5). List the invalid indexes using SELECT pg\_class.relname FROM pg\_class, pg\_index WHERE pg\_index.indisvalid = false AND pg\_index.indexrelid = pg\_class.oid; Drop each invalid index listed above using DROP INDEX \<indexname\>; Try the REINDEX again.

But I’m still getting:

```plaintext
discourse=# REINDEX SCHEMA CONCURRENTLY public;
WARNING: cannot reindex invalid index "pg_toast.pg_toast_19337_index_ccnew" concurrently, skipping
WARNING: cannot reindex invalid index "pg_toast.pg_toast_19337_index_ccnew1" concurrently, skipping

```

and those don’t want to be dropped!

```plaintext
# drop index pg_toast_19337_index_ccnew1;
ERROR: index "pg_toast_19337_index_ccnew1" does not exist

```

---

_[View the full topic](https://meta.discourse.org/t/restoring-from-backup-failing-failure-creating-postgres-index/153014)._
