On 2020-Aug-25, Tom Lane wrote:
> Oh wait a second. Matviews can have indexes, and getTables doesn't
> lock them (because we don't allow LOCK TABLE on views).
Here's a quick patchset that makes pg_dump do LOCK TABLE on all
relations it dumps; patch 0001 allows server-side LOCK TABLE to run on
any relkind, and then 0002 makes pg_dump test for that capability at
connection start, and if it exists, then it's used for all relations to
dump.