【发布时间】:2021-05-11 04:30:33
【问题描述】:
我要恢复的 PostgreSQL 版本是 9.4.10。我从同一版本备份了一个数据库。我用于恢复的命令是:
/opt/PostgreSQL/9.4/bin/pg_restore -U postgres --port=5432 -v --dbname=mydb < /backups/309646/WAL/pipe_309646
我得到的错误是:
pg_restore: executing BLOB 71197
pg_restore: [archiver (db)] Error from TOC entry 3822; 2613 71197 BLOB 71197 user
pg_restore: [archiver (db)] could not execute query: ERROR: duplicate key value violates unique constraint "pg_largeobject_metadata_oid_index"
DETAIL: Key (oid)=(71197) already exists.
Command was: SELECT pg_catalog.lo_create('71197');
这在 pg 错误中重复了大约 112 次。我需要恢复到同一个数据库。这是我用于转储的命令:
/opt/PostgreSQL/9.4/bin/pg_dump" -U postgres -Fc -b --port=5432 'mydb' -t public.users > /backups/309646/WAL/pipe_309646
任何迹象表明为什么会发生这种情况?如何缓解此错误?
【问题讨论】:
标签: postgresql database-administration pg-restore