pg_get_viewdef error while running pg_dump in PostgreSQL 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.
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.