The REFRESH MATERIALIZED VIEW command acquires AccessExclusiveLock table lock . Following are the locks REFRESH MATERIALIZED VIEW acquires, the commands that are allowed to run concurrently with its lock AccessExclusiveLock and the commands that conflict with it. The list also includes the conflicting row locks if applicable
Commands concurrently allowed on the table with REFRESH MATERIALIZED VIEW
Nothing is allowed to run concurrently with REFRESH MATERIALIZED VIEW
Commands conflicting with REFRESH MATERIALIZED VIEW on the table
e.g. If tx1 does a REFRESH MATERIALIZED VIEW on the table then concurrently tx2 tries to do any of the following commands on the same table, tx2 will be blocked. Conversely, if tx1 executes any of the following commands and then tx2 concurrently tries to execute REFRESH MATERIALIZED VIEW, tx2 will block.