Skip to content

Commit 315a73d

Browse files
committed
Minor bugfix and make fetch_statentries_for_relation to be accesible by extensions.
1 parent 0bbcb3a commit 315a73d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/backend/statistics/extended_stats.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ typedef struct StatExtEntry
7575
} StatExtEntry;
7676

7777

78-
static List *fetch_statentries_for_relation(Relation pg_statext, Oid relid);
7978
static VacAttrStats **lookup_var_attr_stats(Relation rel, Bitmapset *attrs, List *exprs,
8079
int nvacatts, VacAttrStats **vacatts);
8180
static void statext_store(Oid statOid, bool inh,
@@ -420,7 +419,7 @@ statext_is_kind_built(HeapTuple htup, char type)
420419
/*
421420
* Return a list (of StatExtEntry) of statistics objects for the given relation.
422421
*/
423-
static List *
422+
List *
424423
fetch_statentries_for_relation(Relation pg_statext, Oid relid)
425424
{
426425
SysScanDesc scan;

src/backend/utils/cache/typcache.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ lookup_type_cache(Oid type_id, int flags)
468468

469469
tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type_id));
470470
if (!HeapTupleIsValid(tp))
471-
ereport(PANIC,
471+
ereport(ERROR,
472472
(errcode(ERRCODE_UNDEFINED_OBJECT),
473473
errmsg("type with OID %u does not exist", type_id)));
474474
typtup = (Form_pg_type) GETSTRUCT(tp);

src/include/statistics/statistics.h

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ extern MVNDistinct *statext_ndistinct_load(Oid mvoid, bool inh);
101101
extern MVDependencies *statext_dependencies_load(Oid mvoid, bool inh);
102102
extern MCVList *statext_mcv_load(Oid mvoid, bool inh);
103103

104+
extern List *fetch_statentries_for_relation(Relation pg_statext, Oid relid);
104105
extern void BuildRelationExtStatistics(Relation onerel, bool inh, double totalrows,
105106
int numrows, HeapTuple *rows,
106107
int natts, VacAttrStats **vacattrstats);

0 commit comments

Comments
 (0)