0

Occasionally, I get the following error while doing a simple pg_dump ( pg_dump -U postgres -Fc -f mybackup.dmp mydb):

pg_dump: [archiver (db)] query failed: ERROR:  could not open relation with OID 11072443
    pg_dump: [archiver (db)] query was: SELECT pg_catalog.pg_get_viewdef('11072443'::pg_catalog.oid) AS viewdef

The dump is then aborted.

I'm using PostgreSQL and pg_dump 9.2.2 for Windows.

Solutions welcome.

  • The latest 9.2 is 9.2.9. Could you reproduce it with it? – Milen A. Radev Oct 20 '14 at 21:26
  • The fact that it is occasional is interesting. Any antivirus software on the computer? That's a common culprit. – Craig Ringer Oct 20 '14 at 21:31
  • Is it the same OID each time you get the error? If so, I'm betting on database corruption. Can you convert that OID to a table name (SELECT 11072443::regclass), and COPY that table manually to a file? – Josh Kupershmidt Oct 21 '14 at 12:47
1

Thanks guys for the suggestions, I think I found the problem.

Each night, several bash scripts drop and recreate some tables, which each time get a new OID. This would explain why a different OID was appearing in each successive error message, as suggested by Josh.

I believe that on some occasions, pg_dump started while some of these tables were still being dropped/recreated, hence the error message.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.