Hi Ann,
Thanks for filing the bug. Surprisingly we still have that kind of 3 way
deadloads.
I guess this is because not a lots of people running these command together.
You don't need a restart to get out, though. Canceling the VACUUM FULL
or the DROP DATABASE from a session that is already connected breaks
the cycle, and so does kill -INT on one of them from the shell.
The attached patch locks pg_database before taking
WrapLimitsVacuumLock. The scan of pg_database still runs under the
LWLock, so the race fixed by 566372b3d64 stays fixed.
Thanks,
Shihao