diff --git a/pkg/sql/create_stats.go b/pkg/sql/create_stats.go index dd67725ab8ed..77c0f8721578 100644 --- a/pkg/sql/create_stats.go +++ b/pkg/sql/create_stats.go @@ -233,12 +233,6 @@ func (n *createStatsNode) makeJobRecord(ctx context.Context) (*jobs.Record, erro ) } - if tableDesc.GetID() == keys.JobsTableID { - return nil, pgerror.New( - pgcode.WrongObjectType, "cannot create statistics on system.jobs", - ) - } - if tableDesc.GetID() == keys.ScheduledJobsTableID { return nil, pgerror.New( pgcode.WrongObjectType, "cannot create statistics on system.scheduled_jobs", diff --git a/pkg/sql/logictest/testdata/logic_test/distsql_stats b/pkg/sql/logictest/testdata/logic_test/distsql_stats index 88cc2f09fff8..02d9db026792 100644 --- a/pkg/sql/logictest/testdata/logic_test/distsql_stats +++ b/pkg/sql/logictest/testdata/logic_test/distsql_stats @@ -1657,8 +1657,8 @@ ANALYZE system.lease statement error pq: cannot create statistics on system.table_statistics ANALYZE system.table_statistics -# Collecting stats on system.jobs is disallowed. -statement error pq: cannot create statistics on system.jobs +# Collecting stats on system.jobs is allowed. +statement ok ANALYZE system.jobs # Collecting stats on system.scheduled_jobs is disallowed.