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