Answer the question
In order to leave comments, you need to log in
Why does pg_restore restore a database without indexes?
Pg_dump periodically deploys a database without indexes, although the database from which the dump is taken has them. What could be causing this?
I expand like this:
pg_restore -h 127.0.0.1 -U "postgres" -w -d mydb -j 4 --verbose /tmp/db.backup
Answer the question
In order to leave comments, you need to log in
In general, redirecting the output to a file did not help, but I found the postgres logs in /var/log/postgresql. They confirmed that the reason is the lack of disk space.
This can happen, for example, if for some reason the source database (from which the backup is being made) contains inconsistent data (not satisfying the restrictions) - in this case, when restoring the backup, the database will not be able to create a restriction, it will fall off with an error, and everything after this constraint is created (including indexes) will no longer be created. But this should be visible in the output of the pg_restore command - redirect the output of this command to a file and study in detail after the restoration is completed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question