diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2021-04-21 18:36:12 -0400 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2021-04-21 18:36:12 -0400 |
commit | 7c298c6573a0f181963ddcb40c850fa9c7da0ada (patch) | |
tree | f76f738b7f56facc8f920186a7243b3f18c15c99 | |
parent | 7b357cc6ae553c0ecacdc11b2e5278b7bf477dba (diff) | |
download | postgresql-7c298c6573a0f181963ddcb40c850fa9c7da0ada.tar.gz postgresql-7c298c6573a0f181963ddcb40c850fa9c7da0ada.zip |
Add comment about extract_autovac_opts not holding lock
Per observation from Tom Lane.
Discussion: https://postgr.es/m/1901125.1617904665@sss.pgh.pa.us
-rw-r--r-- | src/backend/postmaster/autovacuum.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 83c584ddc8c..d516df0ac5c 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2783,6 +2783,11 @@ deleted2: * * Given a relation's pg_class tuple, return the AutoVacOpts portion of * reloptions, if set; otherwise, return NULL. + * + * Note: callers do not have a relation lock on the table at this point, + * so the table could have been dropped, and its catalog rows gone, after + * we acquired the pg_class row. If pg_class had a TOAST table, this would + * be a risk; fortunately, it doesn't. */ static AutoVacOpts * extract_autovac_opts(HeapTuple tup, TupleDesc pg_class_desc) |