我有一个运行以下内容的脚本:
pg_restore tmp/latest.backup --verbose --clean --no-acl --no-owner --dbname hub_development --jobs=12
Run Code Online (Sandbox Code Playgroud)
这经常失败并出现以下错误:
error: could not find block ID 4584 in archive -- possibly due to out-of-order restore request, which cannot be handled due to lack of data offsets in archive
pg_restore: error: a worker process died unexpectedly
Run Code Online (Sandbox Code Playgroud)
反过来,这个错误意味着应该有索引、主键等的表最终没有它们。例如,在没有多核的情况下运行时,我们的users表如下所示,正如预期的那样:
Table "public.users"
Column | Type | Collation | Nullable | Default
--------------------+-----------------------------+-----------+----------+-----------------------------------
id | integer | | not null | nextval('users_id_seq'::regclass)
created_at | timestamp without time zone | | not null …Run Code Online (Sandbox Code Playgroud)