diff --git a/pkg/sql/pg_catalog.go b/pkg/sql/pg_catalog.go index bc2d5472c2c5..c6196a496c45 100644 --- a/pkg/sql/pg_catalog.go +++ b/pkg/sql/pg_catalog.go @@ -1145,7 +1145,9 @@ func makeAllRelationsVirtualTableWithDescriptorIDIndex( h := makeOidHasher() scResolver := oneAtATimeSchemaResolver{p: p, ctx: ctx} sc, err := p.Descriptors().GetImmutableSchemaByID( - ctx, p.txn, table.GetParentSchemaID(), tree.SchemaLookupFlags{}) + ctx, p.txn, table.GetParentSchemaID(), tree.SchemaLookupFlags{ + Required: true, + }) if err != nil { return false, err }