Skip to content

Commit 42c80c6

Browse files
committed
Assert that syscache lookups don't happen outside transactions.
Andres Freund
1 parent ac33c7e commit 42c80c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/utils/cache/catcache.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "access/sysattr.h"
2222
#include "access/tuptoaster.h"
2323
#include "access/valid.h"
24+
#include "access/xact.h"
2425
#include "catalog/pg_operator.h"
2526
#include "catalog/pg_type.h"
2627
#include "miscadmin.h"
@@ -1067,6 +1068,9 @@ SearchCatCache(CatCache *cache,
10671068
SysScanDesc scandesc;
10681069
HeapTuple ntp;
10691070

1071+
/* Make sure we're in a xact, even if this ends up being a cache hit */
1072+
Assert(IsTransactionState());
1073+
10701074
/*
10711075
* one-time startup overhead for each cache
10721076
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy