Autovacuuming process holds RowExclusiveLock and ShareUpdateExclusiveLock on the table, which I want to drop. I read that autovacuum should be canceled automatically, when submitting DROP TABLE command, but it doesn't happen. Maybe I have wrong configuration of postgresql? Furthermore I don't have any delete or update operations of those tables — only inserts and drops. Can I disable autovacuum on those particular tables?
Postgresql cannot drop a table when autovacuum holds lock on it
lockingpostgresqlpostgresql-9.1vacuum
Related Question
- PostgreSQL Restore – Disable Constraints and Table Checks During Dump Restore
- PostgreSQL 9.6 Autovacuum – Challenges After Upgrade
- PostgreSQL Locking – Can Simultaneous Updates and Deletes Lead to AccessExclusiveLock?
- PostgreSQL Autovacuum Table-Level Lock – How to Avoid ACCESS EXCLUSIVE on Replicas
- Postgresql 11 – slow insert performance when table reaches ~5 million records
- PostgreSQL – Zabbix Partitioning Autovacuum Causes Locking
- PostgreSQL Restart – Is It Safe if Process Terminated?
Best Answer
If no delete or update happened, autovacuum shouldn't process the table, per
autovacuum_analyze_threshold
. See Automatic Vacuuming for the relevant configuration parameters.You may set
log_autovacuum_min_duration
to zero to help figure out what's being autovacuumed.In any case, it is possible to completely disable autovacuum for a particular table, with:
This is documented in Storage parameters.