diff options
Diffstat (limited to 'src/backend/utils/cache/inval.c')
-rw-r--r-- | src/backend/utils/cache/inval.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c index 4893dbdd7c8..c93679dfdcc 100644 --- a/src/backend/utils/cache/inval.c +++ b/src/backend/utils/cache/inval.c @@ -683,7 +683,8 @@ PrepareInvalidationState(void) { TransInvalidationInfo *myInfo; - Assert(IsTransactionState()); + /* PrepareToInvalidateCacheTuple() needs relcache */ + AssertCouldGetRelation(); /* Can't queue transactional message while collecting inplace messages. */ Assert(inplaceInvalInfo == NULL); @@ -752,7 +753,7 @@ PrepareInplaceInvalidationState(void) { InvalidationInfo *myInfo; - Assert(IsTransactionState()); + AssertCouldGetRelation(); /* limit of one inplace update under assembly */ Assert(inplaceInvalInfo == NULL); @@ -928,6 +929,12 @@ InvalidateSystemCaches(void) void AcceptInvalidationMessages(void) { +#ifdef USE_ASSERT_CHECKING + /* message handlers shall access catalogs only during transactions */ + if (IsTransactionState()) + AssertCouldGetRelation(); +#endif + ReceiveSharedInvalidMessages(LocalExecuteInvalidationMessage, InvalidateSystemCaches); @@ -1436,6 +1443,9 @@ CacheInvalidateHeapTupleCommon(Relation relation, Oid databaseId; Oid relationId; + /* PrepareToInvalidateCacheTuple() needs relcache */ + AssertCouldGetRelation(); + /* Do nothing during bootstrap */ if (IsBootstrapProcessingMode()) return; |