diff options
Diffstat (limited to 'src/backend/utils/cache')
| -rw-r--r-- | src/backend/utils/cache/lsyscache.c | 14 | ||||
| -rw-r--r-- | src/backend/utils/cache/syscache.c | 10 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 0b50309bf3..fc1c21bc4a 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.163 2009/08/10 05:46:50 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.164 2009/12/29 20:11:45 tgl Exp $ * * NOTES * Eventually, the index information should go through here, too. @@ -2524,6 +2524,9 @@ get_typmodout(Oid typid) * Given the table and attribute number of a column, get the average * width of entries in the column. Return zero if no data available. * + * Currently this is only consulted for individual tables, not for inheritance + * trees, so we don't need an "inh" parameter. + * * Calling a hook at this point looks somewhat strange, but is required * because the optimizer calls this function without any other way for * plug-ins to control the result. @@ -2540,10 +2543,11 @@ get_attavgwidth(Oid relid, AttrNumber attnum) if (stawidth > 0) return stawidth; } - tp = SearchSysCache(STATRELATT, + tp = SearchSysCache(STATRELATTINH, ObjectIdGetDatum(relid), Int16GetDatum(attnum), - 0, 0); + BoolGetDatum(false), + 0); if (HeapTupleIsValid(tp)) { stawidth = ((Form_pg_statistic) GETSTRUCT(tp))->stawidth; @@ -2609,7 +2613,7 @@ get_attstatsslot(HeapTuple statstuple, if (values) { - val = SysCacheGetAttr(STATRELATT, statstuple, + val = SysCacheGetAttr(STATRELATTINH, statstuple, Anum_pg_statistic_stavalues1 + i, &isnull); if (isnull) @@ -2658,7 +2662,7 @@ get_attstatsslot(HeapTuple statstuple, if (numbers) { - val = SysCacheGetAttr(STATRELATT, statstuple, + val = SysCacheGetAttr(STATRELATTINH, statstuple, Anum_pg_statistic_stanumbers1 + i, &isnull); if (isnull) diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c index efed498f12..59e9ee6026 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/cache/syscache.c,v 1.121 2009/10/05 19:24:45 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/cache/syscache.c,v 1.122 2009/12/29 20:11:45 tgl Exp $ * * NOTES * These routines allow the parser/planner/executor to perform @@ -597,14 +597,14 @@ static const struct cachedesc cacheinfo[] = { }, 1024 }, - {StatisticRelationId, /* STATRELATT */ - StatisticRelidAttnumIndexId, + {StatisticRelationId, /* STATRELATTINH */ + StatisticRelidAttnumInhIndexId, Anum_pg_statistic_starelid, - 2, + 3, { Anum_pg_statistic_starelid, Anum_pg_statistic_staattnum, - 0, + Anum_pg_statistic_stainherit, 0 }, 1024 |
