aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2018-07-12 13:50:17 +0900
committerMichael Paquier <michael@paquier.xyz>2018-07-12 13:50:17 +0900
commit6551f3daa2567ea9b2ded9b467aa9d876cc4e77f (patch)
tree696107f47f7b74ab8d32a6220f2d137e3d7f7f1e /src
parent9a7b7adc130a197e5c993a99e6aaa981f9341a35 (diff)
downloadpostgresql-6551f3daa2567ea9b2ded9b467aa9d876cc4e77f.tar.gz
postgresql-6551f3daa2567ea9b2ded9b467aa9d876cc4e77f.zip
Add assertion in expand_vacuum_rel() for non-autovacuum path
The code path where the assertion is added helps to check that autovacuum always includes a relation OID when doing a vacuum on it. Extracted from a larger patch set to add support for SKIP LOCKED with manual VACUUM commands. Author: Nathan Bossart Discussion: https://postgr.es/m/9EF7EBE4-720D-4CF1-9D0E-4403D7E92990@amazon.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/vacuum.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index d90cb9a9022..e16d8ef212a 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -444,6 +444,12 @@ expand_vacuum_rel(VacuumRelation *vrel)
bool include_parts;
/*
+ * Since autovacuum workers supply OIDs when calling vacuum(), no
+ * autovacuum worker should reach this code.
+ */
+ Assert(!IsAutoVacuumWorkerProcess());
+
+ /*
* We transiently take AccessShareLock to protect the syscache lookup
* below, as well as find_all_inheritors's expectation that the caller
* holds some lock on the starting relation.