diff --git a/src/bgw/job.c b/src/bgw/job.c index 0eb993895e6..5414b6d823d 100644 --- a/src/bgw/job.c +++ b/src/bgw/job.c @@ -961,6 +961,10 @@ void ts_bgw_job_validate_job_owner(Oid owner) { HeapTuple role_tup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(owner)); + + if (!HeapTupleIsValid(role_tup)) + elog(ERROR, "cache lookup failed for role %u", owner); + Form_pg_authid rform = (Form_pg_authid) GETSTRUCT(role_tup); if (!rform->rolcanlogin)