How to recreate all index

Hi

Yesterday I need import an SQL backup, but I encounter a problem :

psql:mastodon.dump:32082526: ERROR:  could not create unique index "index_tags_on_name_lower"
DETAIL:  Key (lower(name::text))=(ヤギ) is duplicated.
CONTEXT:  parallel worker

So, I drop this line and… I lost some index.
I search how to recreate all index without loosing data to optimize Mastodon (because actually it destroy my disk).

Thank in advance for your help :slight_smile:
Regard

Is your database empty before the import?

Yes, I drop it and just recreate it.

When I search is tags, I have some tags duplicate

mastodon=# select * from tags where name = 'freesoftware';
     name     |         created_at         |         updated_at         |   id   | usable | trendable | listable | reviewed_at | requested_review_at |       last_status_at       | max_score | max_score_at
--------------+----------------------------+----------------------------+--------+--------+-----------+----------+-------------+---------------------+----------------------------+-----------+--------------
 freesoftware | 2019-12-25 22:35:58.374434 | 2019-12-25 22:35:58.406384 | 192237 |        |           |          |             |                     | 2019-12-25 22:35:58.405993 |           |
 freesoftware | 2017-04-28 09:33:45.12065  | 2020-01-02 11:37:38.54757  |   3317 |        |           |          |             |                     | 2020-01-02 11:37:38.546861 |           |
(2 rows)

(For example.)
The 25 december between 11 AM and 1 PM I migrate PostgreSQL 9.6 to 11. But the creation date does not match with this action.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.