Kirill Reshke <reshke@double.cloud> writes: > As you can see, after drop role there is invalid records in pg_init_privs > system relation. After this, pg_dump generate sql statements, some of which > are based on content of pg_init_privs, resulting in invalid dump.
Ugh. > PFA fix. I don't think this is anywhere near usable as-is, because it only accounts for pg_init_privs entries in the current database. We need to handle these records in the DROP OWNED BY mechanism instead, and also ensure there are shared-dependency entries for them so that the role can't be dropped until the entries are gone in all DBs. The real problem may be less that DROP is doing the wrong thing, and more that creation of the pg_init_privs entries neglects to record a dependency. regards, tom lane