© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
ImmichI
Immich•10mo ago•
37 replies
emielregis

Postgres errors when restoring

I am testing my backups and am seeing a new error. The restore itself seems to be working, but I'm unsure what is leading to this error.

Error message (appears twice as postgres is being restored):
ERROR:  called `Result::unwrap()` on an `Err` value: Error { inner: Error { inner: TomlError { message: "invalid table header\nexpected newline, `#`", original: Some("[indexing.hnsw]\r\r\nm = 16\r\r\nef_construction = 300"), keys: [], span: Some(15..16) } } }
ERROR:  called `Result::unwrap()` on an `Err` value: Error { inner: Error { inner: TomlError { message: "invalid table header\nexpected newline, `#`", original: Some("[indexing.hnsw]\r\r\nm = 16\r\r\nef_construction = 300"), keys: [], span: Some(15..16) } } }


Command used to backup:
docker exec -t immich_postgres pg_dumpall -c -U postgres > /path/to/database-backup/immich-database.sql
docker exec -t immich_postgres pg_dumpall -c -U postgres > /path/to/database-backup/immich-database.sql


Command used to restore:
cat /path/to/database-backup/immich-database.sql | sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" | docker exec -i immich_postgres psql --dbname=postgres --username=postgres
cat /path/to/database-backup/immich-database.sql | sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" | docker exec -i immich_postgres psql --dbname=postgres --username=postgres


Relevant history:
- This installation has been up for a very long time - about two years.
- It went through the pgvector to pgvecto.rs breaking change, etc.
- I restored from a backup a few months back and re-initialized the db to use data checksums. There were no errors at the time. No changes have been made to the compose file since.
ImmichJoin
A place to hang out, get support, discuss Immich, get announcements about releases and anything else going on.
36,590Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Restoring postgres onto TrueNAS install? (Docker -> TrueNAS)
ImmichIImmich / help-desk-support
11mo ago
Restoring database, a lot of MySQL errors.
ImmichIImmich / help-desk-support
3y ago
messed up my postgres database, need help restoring.
ImmichIImmich / help-desk-support
2mo ago
Getting missing files errors after restoring from backup
ImmichIImmich / help-desk-support
3w ago