PostgreSQL autovacuum can take an AccessExclusiveLock when truncating tables
PostgreSQL VACUUM and autovacuum can briefly take an AccessExclusiveLock when truncating empty pages at the end of a table. Here is why it happens and how vacuum_truncate=false avoids it.
Gerard Rodes