Postgresql – Error during pg_restore: text search dictionary “unaccent” does not exist

postgresqlpostgresql-9.3restoreunaccent

I'm trying to move data between servers. I recreated the whole database structure, checked that same users exist and the unaccent extension that we use is enabled for all schemas of the target database.

When I try to run:

pg_restore -h %server_host% -a -c --disable-triggers -d %db_name% -U %user_name% 2014-12-09.custom

I get the following error:

pg_restore: [archiver (db)] COPY failed for table "contracts":
ERROR:  text search dictionary "unaccent" does not exist

What am I missing here?

Best Answer

It came out that there was a stupid hack, unaccent function was marked immutable and there was an index that used this unaccent function. Dropping the index and recreating it after backup did the trick.

Do not use hacks, folks :)