I'm running backup restore on a schema every day and get this every now and then:
pg_dump: Error message from server: ERROR: relation not found (OID
86157003) DETAIL: This can be validly caused by a concurrent delete
operation on this object. pg_dump: The command was: LOCK TABLE
myschema.products IN ACCESS SHARE MODE
How can this be avoided? It seems the table was being used at the time, or someone was running something aginst the table.
As far as I understand, pg_dump could run even if users are doing something with the table but it doesn't seem to be the case.
Thanks,
Best Answer
From
pg_dump
manual:So
pg_dump
can run when other users use database, but not when tables are being dropped. Your error message clearly states, that the object was not found and that's what caused locking to fail. It's also hinted in that message that it probably got deleted.To avoid in the future, verify what could cause the object to be deleted during backup (maintenance? maybe some periodically run scripts/functions delete tables?) and schedule your backup after that.