Check if PgIvmImmvRelationId is invalid before open it
This commit is contained in:
parent
8f87d0914a
commit
c888c1aee7
1 changed files with 7 additions and 2 deletions
9
pg_ivm.c
9
pg_ivm.c
|
|
@ -385,11 +385,16 @@ PgIvmObjectAccessHook(ObjectAccessType access, Oid classId,
|
|||
|
||||
if (access == OAT_DROP && classId == RelationRelationId && !OidIsValid(subId))
|
||||
{
|
||||
Relation pgIvmImmv = table_open(PgIvmImmvRelationId(), AccessShareLock);
|
||||
Relation pgIvmImmv;
|
||||
SysScanDesc scan;
|
||||
ScanKeyData key;
|
||||
HeapTuple tup;
|
||||
|
||||
Oid pgIvmImmvOid = PgIvmImmvRelationId();
|
||||
|
||||
if (pgIvmImmvOid == InvalidOid)
|
||||
return;
|
||||
|
||||
pgIvmImmv = table_open(pgIvmImmvOid, AccessShareLock);
|
||||
ScanKeyInit(&key,
|
||||
Anum_pg_ivm_immv_immvrelid,
|
||||
BTEqualStrategyNumber, F_OIDEQ,
|
||||
|
|
|
|||
Loading…
Reference in a new issue